javascript - Substraction two textbox values with jquery -


this question has answer here:

i have 2 textbox follow:

<input id="amount" name="amount" type="text" value="0" /> <input id="discount" name="discount" type="text" value="0" /> 

i want substract discount amount, , add result textbox. how can it?

$("#result").val(parseint($("#amount").val(), 10) - parseint($("#discount").val(), 10)); 

that should it. jsfiddle here.


Comments