Remove text from fields on input - Javascript jQuery

Javascript examples for jQuery:Form Text Input

Description

Remove text from fields on input

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.4.2.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*  www  . ja  v a 2s  . c o m*/
 $('#myTextbox').focus(function() {
    $(this).val("");
  });
    });

      </script> 
   </head> 
   <body> 
      <input id="myTextbox" type="text" name="myTextbox" value="FooBar">  
   </body>
</html>

Related Tutorials