I have a text filed in my form. The color of the text in the text field should be in grey color. If i click it and type, the text should turn black and remains to be in black color.
I used the following css.
input[type=text]{ color:#999999;}
input[type=text]:focus{ color:#000;}
This is my html code
<input name="address" id="address" type="text" onFocus="if(this.value =='Address' ) this.value=''" onBlur="if(this.value=='') this.value='Address'" value="Address">
Now the text turns to black color when i am typing. But it turns back to grey color after typing. I need it to be in black after typing. How can i do that?
placeholderattribute for the input field?