I want to make a thing that adds two numbers with prompt()
s and when it returns the sum it shows the numbers in the wrong way. For instance, I would put 5 for the first number and 2 for the second number and it returns 52. Here's the code
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h2 id="h2">gonna be something</h2>
<button onclick="math()">might do something</button>
<script>
function math() {
var text = document.getElementById("h2")
var question1 = prompt("enter a number","here")
var question2 = prompt("enter a second number","here")
text.innerHTML =
question1 += question2
}
</script>
</body>
</html>