Input type text field value returning exact text - Javascript jQuery

Javascript examples for jQuery:Form Text Input

Description

Input type text field value returning exact text

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.6.4.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*w ww .j a  v a2 s. co m*/
$("#btnDisplay").click(function(){
    $("#lblName").text($("#txtName").val());
});
    });

      </script> 
 </head> 
 <body> 
  <input type="text" id="txtName"> 
  <input type="button" id="btnDisplay" value="Display"> 
  <p id="lblName"></p>  
 </body>
</html>

Related Tutorials