I want to update h3 tag every time user clicks but it does not update it updates the tab url but i do not want to update URL, I wanted to update only h3 tag.
I attached all files and URL screenshot.
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <form>
            <h3 id="url">https://localhost:8080/</h3>
            <label for="name">Name :</label><br>
            <input type="text" id="name" name="name"><br>
            <label for="year">Graduation Year :</label><br>
            <input type="number" id="year" name="year"><br>
            <button id="button" onclick="updateURL()">Submit</button>
        </form>
        <script src="app.js"></script>
    </body>
</html>
here javaScript code.
const name = document.getElementById("name").innerHTML;
const year = document.getElementById("year").innerHTML;
let url = document.getElementById("url");
const oldURL = url.innerHTML;
const newURL = oldURL + "?name=" + name + "&year=" + year;
function updateURL() {
    
    url.innerHTML = newURL;
}
console.log("hiii");
console.log(oldURL)
console.log(newURL);
 
    