【发布时间】:2012-03-31 13:46:35
【问题描述】:
如果元素样式属性很重要(通过style="" 或JS 设置),如何删除它?
removeProperty() 不起作用 (jsfiddle):
elem.style.setProperty('background', '#faa', 'important');
elem.style.removeProperty('background'); // doesn't work
(最好是无框架的解决方案,它只需要在 Chrome 中工作。)
【问题讨论】:
标签: javascript css google-chrome