Wednesday, February 19, 2014

How Add Two Number In using javascript

<html>
<script>
function addvalues(){
var a=parseInt(document.form.first.value);
var b=parseInt(document.form.second.value);
var c;
c=a+b;
document.getElementById('result').innerHTML=c;

}
</script>
<body>
<form name="form">
Enter the First Number<br>
<input type="text" name="first">
<br>

Enter the Second Number<br>
<input type="text" name="second">
<br>
<input type="button" value="add this" onclick='addvalues()'>

</form>
Result Show Here
<div id="result"></div>
</body>
</html>
Enter the First Number

Enter the Second Number

Result Show Here