Posted By

fadehelix on 02/08/11


Tagged

clear


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rbulgueroni


Clear input default value on click


 / Published in: jQuery
 

  1. $(document).ready(function() {
  2. $('#inputWrapper').click(function() {
  3. if($(':input','#formId').val() == 'Search...')
  4. {
  5. $(':input','#formId').val('');
  6. }
  7. });
  8. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Some0ne on February 9, 2011

.focus would be better then .click imo

You need to login to post a comment.