Last post Aug 23, 2015 11:17 PM by Fei Han - MSFT
Aug 22, 2015 05:57 AM|asish112|LINK
can anyone tell me how to do aritmatic operations program using HTML control and jquery ?
Aug 22, 2015 01:03 PM|Rion Williams|LINK
I suppose it depends on what type of arithmetic operations you want to perform.
Let's say you have two textboxes (A and B) and you want to read values from these and display them within another textbox (C). An example of that might look something like this :
<input id='a' /> + <input id='b' /> <button id='add'>=</button> <input id='c' disabled />
// Attempt to read an integer from your textboxes
var a = parseInt($("#a").val(),10);
var b = parseInt($("#b").val(),10);
// Add them and store the result in c
var c = a + b;
// Output the result in your c textbox
You can see a working example of this here.
Aug 23, 2015 11:17 PM|Fei Han - MSFT|LINK
Welcome to ASP.NET forum.
Firstly, you need to get the data from inputs via
jQuery selectors like this.