Dynamic Calculations in Text Boxes with key event - Javascript jQuery

Javascript examples for jQuery:Text

Description

Dynamic Calculations in Text Boxes with key event

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from   w  w w .j  a va  2 s  . c om
$('input').on("keyup",function () {
    $("#result").val(parseInt($("#amount").val(), 10)*  15);
});
    });

      </script> 
 </head> 
 <body> 
  <input id="amount" name="amount" type="text" value="0"> 
  <input id="result" name="discount" type="text" value="0">  
 </body>
</html>

Related Tutorials