Css属性存在性判断问题?
.a{color:red;}
<div id= "a " class= "a "> A </div>
通过JS我怎么知道div有没有color的属性?如果没有执行e.style.color= 'blue ';
------解决方案--------------------抠门,哈
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<title> new document </title>
<meta name= "generator " content= "editplus " />
<meta name= "author " content= " " />
<meta name= "keywords " content= " " />
<meta name= "description " content= " " />
<style type= "text/css ">
.divStyle{color:red;}
</style>
</head>
<body>
<div id= "divTest " class= "divStyle "> Test </div>
</body>
<script type= "text/javascript ">
<!--
var oDiv = document.getElementById( "divTest ");
alert(oDiv.currentStyle.color);
//-->
</script>
</html>