/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$.fn.focus_blur = function() { $(this).css({color:'#999999'}); return this.focus(function() { if( this.value == this.defaultValue ) { this.value = ""; } $(this).css({color:'#333333'}); }).blur(function() { if( !this.value.length ) { this.value = this.defaultValue; $(this).css({color:'#999999'}); } }); }; $(".input_textbox").focus_blur();