Simple addition in javascript
by krish
HTML
<html>
<body>
value of a: <input type="text" id="val_a"/>
value of b: <input type="text" id="val_b"/>
<input type="button" id="addbutton" value="Add">
</body>
</html>
JavaScript
$('#addbutton').click(function(){
var a=$('#val_a').val();
var a=parseInt(a);
var b=$('#val_b').val();
var b=parseInt(b);
var c=a+b;
alert('The addition value is'+c);
});