【发布时间】:2019-10-01 20:56:03
【问题描述】:
在这行代码上得到这个错误:
document.getElementsByTagName("table")[0].style.setProperty("background-color", "#D19000", "important");
只有在 IE8 中,去看看,有人知道如何修复它吗?
【问题讨论】:
-
或许可以试试
... [0].style["backgroundColor"] = "#D19000" -
可以使用 polyfill
CSSStyleDeclaration.prototype.setProperty = function (name, value, priority) { this[name] = value; };,因为CSSStyleDeclaration在这里,似乎
标签: javascript internet-explorer-8 internet-explorer-7