Filling search query box with text that disappears when clicked on

I have a basic search box that I want filled with light gray text that says <enter search query> or similar, and I want it to disappear when the box is clicked on. I also want the ‘<enter search query>’ to reappear when the page is reloaded.

Any tips, URLs, etc. with info are appreciated.

Thx.

Think I figured this one out also. Instead of javascript changes on the pages where the search box is, I added the below to the backend Perl search script.

$query =~ s/ \<enter query\>//g;

hmmm, another prob though. If someone simply clicks on the search button, the query ends up being <enter query>.

Figured it out. Pretty simple.

<input type=“text” name=“query” size=“16” maxlength=“40” value=" <enter query>" class=“search_box” onFocus=this.value=‘’>