Prev Demo
Subtraction In Javascript
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function () { $("#TextBox2").keyup(function () { var a = parseInt($("#TextBox1").val()); var b = parseInt($("#TextBox2").val()); var c = a - b; $("#TextBox3").val(c); }); }); </script> </head> <body> <form id="form1" runat="server"> <input type="text" ID="TextBox1" value="400" /> Write here <input type="text" ID="TextBox2" /> Result: <input type="text" ID="TextBox3" /> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output