JS 获取元素的属性值,非内联样式

//获取样式表的属性值,IE8及以下不兼容 ,方法
window.getComputedStyle(dom对象,"伪类").style属性;
 
//IE8及以下获取样式表的属性值 ,属性
element.currentStyle.style属性;
 
判断浏览器是否兼容 getComputedStyle 和 currentStyle
if( window.getComputedStyle ){ }
else if( document.body.cyrrentStyle ){ }
 
原文地址:https://www.cnblogs.com/zhangmingze/p/4809371.html