摘要:
js模块代码function getStyle(obj,attr){ if(obj.currentStyle){//兼容ie return obj.currentStyle[attr]; } else{ return getComputedStyle(obj,null)[attr]; }}window.onload=function(){ oDiv= document.getElementsById('div'); console.log((oDiv,'width'));}HTML<div id='div'>fasdfsdfsdfsd 阅读全文