ELEMENT.style.color在IE中不起作用 [英] ELEMENT.style.color not working in IE
问题描述
在一个小型Web应用程序中,我正在使用JavaScript在文本框中设置一些文本及其颜色.
In a small web application I'm setting some text in a text box and its color using JavaScript.
在下面的摘录中,el是我的对象.此代码在Firefox,Opera和Safari下产生正确的效果,但在IE下却没有这种运气.由于大多数示例都使用了x.style.color ="color",因此我一直没有取得成功.我的文本可以正确显示,但颜色为灰色.
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";
el.value = "TEXT"; el.style.color="blue";
推荐答案
在IE中,您无法更改已禁用文本框的文本颜色
In IE, you can't change the text color of a disabled text box
这篇关于ELEMENT.style.color在IE中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!