Posted By

claudiowebdesign on 08/18/11


Tagged

jquery label


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

spee66


Lightweight "label inside input field" snippet


 / Published in: jQuery
 

  1. var field = $('input');
  2. field.focus(function(){
  3. if(field.val()==='Your Name')
  4. field.val('')
  5. }).blur(function(){
  6. if(field.val()==='')
  7. field.val('Your Name')
  8. })

Report this snippet  

You need to login to post a comment.