February 14, 201016 yr I'm missing something here. I want to change the color of the default value for this text field, without changing the overall color of the input field. For example, the default value of 170 will be gray, but when a user overwrites the data with their own numerical value, it will be black. I know how to change the color of the input field when a user types in data, but is there a way to change the color of the value= ? <input type="text" name="trans1_1" size="6" value="170"/> Any ideas? Seems like a simple task, but can't figure it out. Thanks in advance for the time.
February 14, 201016 yr Here's what you do: <input id="myid" type="text" name="trans1_1" size="6" value="170"/> input[type="text"]#myid{ color: #666666;} input[type="text"]#myid:focus{ color: #000000;} Here's a link to the DEMO. Note that the style checks that it's a text type and has an id of myid. +1 me if I've helped!
Create an account or sign in to comment