A brief break from the eye-bleeding CSS talk. LOL! ;o)
I needed a text field to be prefilled with text. If the user clicked on it, the text would clear out. If they "left" the text field (changed focus) without changing it – I needed it to revert back to the original text. If they DID enter information in it, I needed it to NOT revert back to the original text. (Clear as mud?)
Here's what I mean:
Here's how (and why) I did this:
<input name="search" type="text" onFocus="if(this.value=='Search')value="" onBlur="if(this.value==")value='Search';" value="Search" size="10" maxlength="200">
I needed to do this on a site I was working on because I didn't have enough room for a label on the field – but still needed to "explain" what the field was.