/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery('input, textarea').each(function() { var defaultval = this.value; jQuery(this).focus(function() { if(this.value == defaultval) { this.value = ''; } }); jQuery(this).blur(function() { if(this.value == '') { this.value = defaultval; } }); });