Jquery Exclude a Selector?

Posted by Wes on Stack Overflow See other posts from Stack Overflow or by Wes
Published on 2010-06-08T21:10:26Z Indexed on 2010/06/08 21:22 UTC
Read the original article Hit count: 241

Filed under:

I've got a form that I clear on focus. I've selected the whole form and it works great except that the submit button goes blank when I click it.

how can I exclude my input of input#submit from the following code?

    $(".wpcf7-form input, .wpcf7-form textarea").focus(function() {
 if( this.value == this.defaultValue ) {
  this.value = "";
  $(this).addClass('filled');
 }
}).blur(function() {
 if( !this.value.length ) {
  this.value = this.defaultValue;
  $(this).removeClass('filled');
 }
});

© Stack Overflow or respective owner

Related posts about jQuery