问题.style = xxx 设置的样式在ie浏览器保存
document.getElementById('dom').style = 'color: #f00; font-size: 30px !important;'
ie浏览器报错,样式不生效
解决方案
方案1
document.getElementById('dom').setAttribute('style', 'color: #f00; font-size: 30px !important;')
方案2
document.getElementById('dom').style.cssText = 'color: #f00; font-size: 30px !important;'