faqts : Computers : Programming : Languages : JavaScript : Forms : TextAreas/TextFields

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

51 of 59 people (86%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

How can I set the color of text in a text field/text area?

Aug 11th, 2000 10:16
Martin Honnen, Rey Nuņez, sushma sharma,


IE4+ and NN6 allow CSS to do that:
  <INPUT TYPE="text" NAME="fieldName" STYLE="color: orange;">
and you can change that with JavaScript:
  document.formName.fieldName.style.color = 'black';
NN3/4 don't allow to color text fields/text areas (or maybe on unix 
where I remember that
  <FONT COLOR="orange"><INPUT TYPE="text" VALUE="JavaScript"></FONT>
had an effect but I do not have the resources currently to verify 
that.)