var input1 = parseInt(document.getElementById("input1"));
var input2 = parseInt(document.getElementById("input2"));
var button = document.getElementById("button");
button.onclick = function(){
var result = input1 + input2;
document.body.append(result);
}
<input type="text" id="input1">
<h2>+</h2>
<input type="text" id="input2"><br>
<button id="button">=</button>
var input1 = document.getElementById("input1");
var input2 = document.getElementById("input2");
var button = document.getElementById("button");
button.onclick = function(){
var result = parseInt(input1.value) + parseInt(input2.value);
document.body.append(result);
}