Return to Snippet

Revision: 40264
at January 28, 2011 06:14 by Some0ne


Initial Code
$('input').each(function() {

  var default_value = this.value;
  
  $(this).focus(function() {
  if(this.value == default_value) {
  this.value = '';}
  });
  
$(this).blur(function() {
 if(this.value == '') {
 this.value = default_value;}
 });
});

Initial URL

                                

Initial Description

                                

Initial Title
Clear default text in an input box on focus

Initial Tags
jquery

Initial Language
jQuery