It’s the little enhancements that count, right? – This jQuery plugin will clear the default value from a field when it’s focused and will bring it back when it’s blurred (if it’s empty):


$.fn.clearOnFocus = function(){
    /* No attribution required,
       don't use excessively */
    return this.focus(function(){
        var v = $(this).val();
        $(this).val( v === this.defaultValue ? '' : v );
        var v = $(this).val();
        $(this).val( v.match(/^s+$|^$/) ? this.defaultValue : v );



Thanks for reading! Please share your thoughts with me on Twitter. Have a great day!