getAttribute和setAttribute设置style的兼容问题
其实前面写过一篇“获取和设置目标元素的属性值”的,本文补充说明一下里面的兼容性问题:
?
先抛结论:
?if(key == 'style'){ element.style.cssText = value;}?
if(key == 'style'){ element.style.cssText = value;}