基本JavaScript崩溃/挂起IE9,但不包括FF、Ch或Op-“;“未实施”;
我得到以下错误: 脚本16385:未实现 在以下代码行中:基本JavaScript崩溃/挂起IE9,但不包括FF、Ch或Op-“;“未实施”;,javascript,css,internet-explorer,notimplementedexception,Javascript,Css,Internet Explorer,Notimplementedexception,我得到以下错误: 脚本16385:未实现 在以下代码行中: document.getElementById("amtcase").style = "background-color: #FFFFFF;"; “amtcase”是一个文本字段 这只发生在IE9上,在Opera、Chrome和FireFox上测试良好。Do: document.getElementById("amtcase").style["backgroundColor"] = "#FFFFFF"; 或 在IE中,不能像这样分配
document.getElementById("amtcase").style = "background-color: #FFFFFF;";
“amtcase”是一个文本字段
这只发生在IE9上,在Opera、Chrome和FireFox上测试良好。Do:
document.getElementById("amtcase").style["backgroundColor"] = "#FFFFFF";
或
在IE中,不能像这样分配DOM节点的“style”属性。您可以做两种选择:
document.getElementById('amtcase').style.backgroundColor = '#FFFFFF';
或
我不知道任何浏览器支持这种方法,更不用说IE了+1.
document.getElementById('amtcase').style.backgroundColor = '#FFFFFF';
document.getElementById('amtcase').style.cssText = 'background-color: #FFFFFF';