Clearing a default value in a search box with jQuery
<p>Can't seem to achieve this simple functionality! All I want is to clear a default search term in an input box when it is clicked. The following works up to a point but clears any <em>other</em> text entered, I would've thought resetting search_form_text should have solved this:</p>

<pre><code>search_form_text = $('#block-search-0 #edit-search-block-form-l').attr('value');

if (search_form_text == 'Enter search keywords here') {

        $('#block-search-0 #edit-search-block-form-l').click(function() {           
            $('#block-search-0 #edit-search-block-form-l').attr('value', '');
            search_form_text = '';
        });

    }
</code></pre>

<p>Hmmmm... :)</p>
