views:

486

answers:

1

In a small web application I'm setting some text in a text box and its color using JavaScript.

In the following snipped, el is my object. This code produces the correct effects under Firefox, Opera and Safari but no such luck under IE. I've been searching without success since most examples say to use x.style.color="color", which I'm using. My text shows up correctly but the color is grayed out.

The object is a disabled, borderless text box. I get no errors or warnings.

el.value = "TEXT"; el.style.color="blue";

+5  A: 

In IE, you can't change the text color of a disabled text box

Philippe Leybaert