How to perform Sum and Difference in jQuery:
the sum of two numbers:
var a=parseInt($("#d1").val());
var b=parseInt($("#d2").val());
var sum=a+b;
alert($(sum));
the difference between two numbers:
var a=parseInt($("#d1").val());
var b=parseInt($("#d2").val());
var diff=a-b;
alert($(diff));
d1 and d2 id of two inputfields
Comments
Leave a comment