The problem is you have not assign any id or anything to get the value. Here is the code ,please try this.
<input type = "text" value = "" id="input1" name="" >
<input type = "text" value = "" id="input2" name="" >
<button onClick="add()"> Add </button>
function add()
{
var input1 = document.getElementById("input1").value;
var input2 = document.getElementById("input2").value;
alert(parseInt(input1) + parseInt(input2));
}