<html>
<head>
<script>
function add(){
var a=document.getElementById("number1").value;
var b=document.getElementById("number2").value;
var z=(parseInt(a)+parseInt(b));
document.getElementById("result").innerHTML="Result :"+z;
}
function sub(){
var a=document.getElementById("number1").value;
var b=document.getElementById("number2").value;
var z=(parseInt(a)-parseInt(b));
document.getElementById("result").innerHTML="Result :"+z;
}
function mul(){
var a=document.getElementById("number1").value;
var b=document.getElementById("number2").value;
var z=(parseInt(a)*parseInt(b));
document.getElementById("result").innerHTML="Result :"+z;
}
function div(){
var a=document.getElementById("number1").value;
var b=document.getElementById("number2").value;
var z=(parseInt(a)/parseInt(b));
document.getElementById("result").innerHTML="Result :"+z;
}
</script>
</head>
<body>

<b>Enter number1 :</b><input type="text" id="number1"><br>
<b>Enter number2 :</b><input type="text" id="number2" style="margin-top:5px;"><br>
<p id="result">Result :</p>
<button  onclick="add()">Add</button>
<button  onclick="sub()">Sub</button> 
<button  onclick="mul()">Mul</button> 
<button  onclick="div()">Div</button>

</body>
</html>
RESULT