I am trying to clear out the text area on focus. This is the code i have used –
<textarea type="text" name="Title" id="title" value="Title" onfocus="if
(this.value==this.defaultValue) this.value='';" cols="20" rows="10" style="width:465px;color:grey;font-size:15px;" wrap="hard">Title</textarea>
This works perfectly in Mozilla Firefox but not in Opera. Can anyone tell me why is it so?
I copied your code and opened it with Opera 11.01 and it worked.
You can also try a JQuery Plugin : http://plugins.jquery.com/project/placeholder
or use HTML 5 Forms with Attribute
placeholder="Title".