Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
190
rated 0 times [  193] [ 3]  / answers: 1 / hits: 28980  / 15 Years ago, thu, march 25, 2010, 12:00:00

I have an input text field, which has a value something by default, but when I start to type, I want that the default value changes color, and the text i'll type, another one.



How can i do that?






<input type=text value=something onclick=this.value='' />

More From » html

 Answers
3

To keep it simple like your example:



<input type=text value=something onclick=this.value='';this.style.color='red'; />


And that should pretty much do it.


[#97242] Monday, March 22, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jocelynkarsynr

Total Points: 472
Total Questions: 98
Total Answers: 96

Location: Macau
Member since Mon, Nov 16, 2020
4 Years ago
jocelynkarsynr questions
Tue, Feb 8, 22, 00:00, 2 Years ago
Sat, Jul 11, 20, 00:00, 4 Years ago
Sun, May 10, 20, 00:00, 4 Years ago
Sat, Jan 18, 20, 00:00, 4 Years ago
;