【发布时间】:2020-09-04 11:35:50
【问题描述】:
我有这个简单的 Javascript 代码来更改自定义 CSS 属性
var root = document.documentElement;
root.style.setProperty("--custom-bg", "#4f5357");
这在 Firefox Google Chrome 中运行良好,但在 IE 11 中无法运行,也尝试过
root['--custom-bg'] = "#4f5357";
root.attr("--custom-bg", "#4f5357");
root.style['--custom-bg'] = "#4f5357";
他们都没有工作。
【问题讨论】:
标签: javascript html jquery css styles