/*alert(div.style.width)*/ //null function getstyle(obj,name){
if(obj.currentStyle) {
return obj.currentStyle[name];
} else {
return getComputedStyle(obj,null)[name];
}
}
alert(getstyle(div,'width'))
}
兼容ie 和非ie浏览器的获取样式写法 ;
zIndex , marginLeft backgroundColor