Jquery: can't get input value - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Jquery: can't get input value

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.8.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/* w ww  .j a va2 s .co m*/
$('#check').on('click',function(){
        var IDnum = $("#IDtag").val();
        console.log(IDnum);
    });
    });

      </script> 
 </head> 
 <body> 
  <input type="text" id="IDtag"> 
  <input type="button" id="check" value="check">  
 </body>
</html>

Related Tutorials