my expected output is
As i type on input text field i get instant sum on third text field
if i type 3 on first text field and key is up , instantly 3+0=3 have to show on third field
but doesnt show any result
$(document).ready(function(){
var a=0, b=0,c=0;
$("input:#a").keyup(function(){
a=$("input:#a").val();
c=a+b;
$("input:#c").append(a+"+"+"b"+"="+c);
});
$("input:#a").keyup(function(){
b=$("input:#b").val();
c=a+b;
$("input:#c").append(a+"+"+b+"="+c);
});
});
<tr><td><input type="text" id="a"></td></tr>
<tr><td><input type="text" id="b"></td></tr>
<tr><td><input type="text" id="c"></td></tr>
You need something along the lines of the following:
This code performs the calculation and puts the result in box C, and automatically updates C with the result of the calculation.