Checking the value while typing in textbox - Javascript jQuery

Javascript examples for jQuery:Form Checkbox

Description

Checking the value while typing in textbox

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 ww w  . ja v  a 2 s.  com
var A = 10;
$('[name="mynumber"]').keyup(function () {
    if (parseInt($(this).val(), 10) > A) {
        console.log("More than A");
    } else {
        console.log("Less than A");
    }
});
    });

      </script> 
 </head> 
 <body> 
  <input type="textbox" name="mynumber">  
 </body>
</html>

Related Tutorials