How can I improve this basic jQuery code?
<p>I'm just starting to get my hands dirty with some basic jQuery. I want to be able to add a "defaultValue" attribute to any textbox and then have the box cleared on focus and then the default value reinserted into the textbox if the value is blank. I've come up with a basic couple of function to do this, but is there a better way? I seem to recall seeing some examples of jQuery functions that don't rely on two separate methods...</p>

<pre><code>$(document).ready(function () {
        $('input[type=text]').click(function () {
            var defaultValue = $(this).attr('defaultValue');
            if ($(this).val() == defaultValue)
                $(this).val('');
        });
        $('input[type=text]').blur(function () {
            var defaultValue = $(this).attr('defaultValue');
            if ($(this).val() == '')
                $(this).val(defaultValue);
        });
    });
</code></pre>
