getComputedStyle

  1、getComputedStyle是一个可以获取当前元素所有最终使用的CSS属性值。返回的是一个CSS样式声明对象([object CSSStyleDeclaration]),只读。不支持IE

  var style = window.getComputedStyle("元素", "伪类");


 2、element.style只能获取元素style属性中的CSS样式


 3、currStyle支持IE

 4、getAttribute
  element.style.getAttribute(驼峰命名)
posted @ 2017-08-07 10:43  欢乐之家  阅读(135)  评论(0编辑  收藏  举报