Get value from input text field with val() method - Javascript jQuery

Javascript examples for jQuery:Form Text Input

Description

Get value from input text field with val() method

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <input id="inputId" type="text"> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> 
      <script type="text/javascript">
        $("#inputId").keyup(function() {
            console.log($("#inputId").val());
        })//from  w  ww  . j  a va 2  s  . c  om
        
      </script>  
   </body>
</html>

Related Tutorials