<!DOCTYPE html>
<html lang="en">
<head>
<script language="JavaScript" type="text/JavaScript">
var a = parseInt(document.getElementById("firstNUMBER").value),
b = parseInt(document.getElementById("secondNUMBER").value),
out = document.getElementById("result");
function add(){
out.innerHTML = a + b;
}
function sub(){
out.innerHTML = a - b;
}
function mul(){
out.innerHTML = a * b;
}
function div(){
out.innerHTML = a / b;
}
</script>
</head>
<body>
<p>
Enter first Number: <input id="firstNUMBER"></br>
Enter second Number: <input id="secondNUMBER"></br>
<input onclick="add()" type="submit" value="Add"/>
<input onclick="sub()" type="submit" value="Sub"/>
<input onclick="mul()" type="submit" value="Mul"/>
<input onclick="div()" type="submit" value="Div"/>
Result: <span id="result"></span>
</p>
</body>
</html>
Enter first number: 10
Enter second number: 20
AddSubMulDiv
Result: 30