Return to Snippet

Revision: 31815
at September 14, 2010 05:05 by Tate


Initial Code
$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;
        }
    });
});

Initial URL

                                

Initial Description
Need to add the class .default-value to the input

Initial Title
OnChange OnFocus Text Input with jQuery

Initial Tags

                                

Initial Language
JavaScript