如何取到非行内样式属性的属性值 //现代浏览器 getComputedStyle(domobj,null)[attr]; //低版本的一些浏览器 domobj.currentStyle[attr]; //兼容写法 function getStyle(domobj,attr){ if(window.getComputedStyle){ return getComputedStyle(domobj,null)[attr]; } return domobj.currentStyle[attr]; }