getAttribute和setAttribute设置style的兼容问题
其实前面写过一篇“获取和设置目标元素的属性值”的,本文补充说明一下里面的兼容性问题:
?
先抛结论:
?
?
IE6-7在使用getAttribute或者setAttribute,不能直接操作样式举例:
?if(key == 'style'){ element.style.cssText = value;}?
发布时间: 2012-11-23 00:03:43 作者: rapoo
getAttribute和setAttribute设置style的兼容问题
其实前面写过一篇“获取和设置目标元素的属性值”的,本文补充说明一下里面的兼容性问题:
?
先抛结论:
?
?
IE6-7在使用getAttribute或者setAttribute,不能直接操作样式?if(key == 'style'){ element.style.cssText = value;}?