remove input textbox default value - Javascript jQuery

Javascript examples for jQuery:Form Text Input

Description

remove input textbox default 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.10.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from w ww .j  a  va2s.  c o  m
$(function() {
    $('#userName').click(function() {
        $(this).val('').unbind('click');
        $(this).focus();
    });
});
    });

      </script> 
 </head> 
 <body> 
  <input type="text" value="user name" id="userName">  
 </body>
</html>

Related Tutorials