Posted By

lynseydesign on 07/19/11


Tagged


Versions (?)

Default search value clear


 / Published in: jQuery
 

  1. $("#keywords").focus(function() {
  2. if( this.value == this.defaultValue ) {
  3. this.value = "";
  4. }
  5. }).blur(function() {
  6. if( !this.value.length ) {
  7. this.value = this.defaultValue;
  8. }
  9. });

Report this snippet  

You need to login to post a comment.