/** * 2013-08-04-通过JS获取CSS属性的值 * [div description] * @type {[type]} */var div = document.getElementById("mydiv");//1.获取行内样式表中CSS的值alert(div.style.width);//2.获取内嵌样式表和外部样式表中CSS的值if(document.defaultView) {    //非IE浏览器    var style = document.defaultView.getComputedStyle(div,null);    alert(style.width);} else if(div.currentStyle) {    //IE浏览器    alert(div.currentStyle.width);}