ITeye博客

仅IE6/7/8下cssText返回值少了分号

zhouyrt · 2011-03-11 10:10 · Brower compatibility · Web前端 · Markdown

如下

 

<!DOCTYPE html>
<html>
<head>
	<title>IE6/7/8下cssText返回值少了分号</title>
</head>
<body>
	<div style="color:red;">TEST</div>
	<script>
		var div = document.getElementsByTagName('div');
		alert(div[0].style.cssText);
	</script>
</body>
</html>

 

 

 各浏览器输出如下

 

IE6/7/8 :

 

 

IE9/Firefox/Chrome/Safari/Opera :

 

 

 

可以看到IE6/7/8中少了分号。使用cssText属性时需注意。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。