so here is my problem, i have a input field i i know its kind of simple but i am just stuck with it:
<input type="text" onfocus="value=''" onblur="value='Enter your email address'" name="emailAddress" value="Enter your email address">
now what it does, when i click in, input field is ready to take input, when i enter some thing and focus/click out, my data disappears and enter your email address from onblur comes in, so any suggestions?
try this:
Demo: http://jsfiddle.net/GdPJa/
onblurcheck if the value is empty, if it’s return the default value, otherwise it doesn’t do anything.