<button onclick="nums()">Input</button>
<p id="number">5</p>
<p id="aNumber"></p>
<script>
function nums() {
var x = parseInt(document.getElementById("number").value);
var y = parseInt(1);
var z = x + y;
document.getElementById("aNumber").innerHTML = z;
}
</script>
</body>
I can't understand why this does not work. What do I need to do to get p with id number to go into a function and turn into an int?