/ Published in: JavaScript

Need to add the class .default-value to the input
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$j('.default-value').each(function() { var default_value = this.value; $j(this).focus(function() { if(this.value == default_value) { this.value = ''; } }); $j(this).blur(function() { if(this.value == '') { this.value = default_value; } }); });
Comments
