
how to write a Java script program to enter number in two text fields and then automatically display the total in another text field..

Javascript sum of two numbers
<html>
<script>
function find(){
var n1=document.getElementById("num1").value;
var n2=document.getElementById("num2").value;
var sum=parseInt(n1)+parseInt(n2);
document.getElementById("res").value=sum;
}
</script>
<pre>
Enter Number1: <input type="text" id="num1" onkeyup="find();">
Enter Number2: <input type="text" id="num2" onkeyup="find();">
Result : <input type="text" id="res">
</pre>
</html>