IE的pre标签使用innerHTML会使white-space不正常,基本上就是pre标签跟div标签一样了。
要注意!可以用div来模拟pre。
要注意!可以用div来模拟pre。



function getRealStyle(id, styleName){
var element = document.getElementById(id);
var realStyle = null;
if(element.currentStyle){
realStyle = element.currentStyle[styleName];
}else if(window.getComputedStyle){
realStyle = window.getComputedStyle(element, null)[styleName];
}
return realStyle;
}