我收到以下错误:
SCRIPT16385:未实施
在以下代码行:
document.getElementById("amtcase").style = "background-color: #FFFFFF;";
“amtcase”是一个文本字段
这只发生在 IE9 上,在 Opera、Chrome 和 FireFox 上测试良好。
我收到以下错误:
SCRIPT16385:未实施
在以下代码行:
document.getElementById("amtcase").style = "background-color: #FFFFFF;";
“amtcase”是一个文本字段
这只发生在 IE9 上,在 Opera、Chrome 和 FireFox 上测试良好。
在 IE 中,您不能像这样分配 DOM 节点的“样式”属性。你可以做几个选择:
document.getElementById('amtcase').style.backgroundColor = '#FFFFFF';
或者
document.getElementById('amtcase').style.cssText = 'background-color: #FFFFFF';
做:
document.getElementById("amtcase").style["backgroundColor"] = "#FFFFFF";
或者
document.getElementById("amtcase").style.backgroundColor = "#FFFFFF";