Posted By

tcelestino on 08/07/10


Tagged

form input jquery


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

lanqy
damanlovett
dubogii


Using focus and blur on input with jQuery


 / Published in: jQuery
 

URL: http://tcelestino.com.br

  1. $(document).ready(function() {
  2.  
  3. $("input[type='text']").focus(function() {
  4. if($(this).val() == 'here your text')
  5. $(this).val("");
  6. });
  7.  
  8. $("input[type='text']").blur(function() {
  9. if($(this).val() == "")
  10. $(this).val("here your text");
  11. });
  12.  
  13.  
  14. });

Report this snippet  

You need to login to post a comment.