I know this must be very simple, but I'm having two issues with my simple JavaScript that I can't figure out. Please bear with any mistakes I'm making - I'm new to this process as well as StackOverflow.
I'm not sure how to add two values from inputs on an HTML page so that the answers are concatenated. My other issue is that when my answer is submitted, it only flashes for a brief moment and then disappears. What am I doing wrong to make this keep occurring? I appreciate any wisdom that you could impart.
<!DOCTYPE html>
<html>
<head>
<title>Doodle, 3-16-18</title>
</head>
<body>
<h1>Calculator</h1>
<form>
<input id="one" type="number">First Number<br>
<input id="two" type="number">Second Number<br>
<button onclick="addNumbers()">Add</button>
</form>
<p id="answer"></p>
<script>
addNumbers() {
var firstNumber = document.getElementById("one").value;
var secondNumber = document.getElementById("two").value;
var answer = firstNumber+ secondNumber;
document.getElementById("answer").innerHTML = answer;
}
</script>
</body>