on focus remove default value and "itl" class


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $('.removeVal').live("click focus", function() {
  2. if (this.value == this.defaultValue) { this.value = ''; $(this).removeClass("itl"); }
  3. });
  4. $('.removeVal').live("blur", function() {
  5. if (this.value == '' || this.value == this.defaultValue) { this.value = this.defaultValue; $(this).addClass("itl"); }
  6. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.