getPropertyVale(propertyName):返回CSS特性propertyName的字符串值.
<html>
<head>
<title></title>
<script>
function useMethods(){
var oDiv=document.getElementById("div1");
alert("aaa");
alert("color="+oDiv.style.color+",width="+oDiv.style.width);
alert(oDiv.style.getPropertyValue("background-color"));
alert(oDiv.style.item[0]);
alert(oDiv.style.getPropertyValue("background-color"));
alert(oDiv.style.removeProperty("background-color"));
}
</script>
</head><body>
<div id="div1" style="background-color:red;height:50px;width:30px;color:white">aaa</div>
<br> <a href="http://www.baidu.com" title="baidudd">dds</a><br>
<input type="button" value="Use Methods" onclick="useMethods()"/></body>
</html>當執行到 alert(oDiv.style.getPropertyValue("background-color"));出錯,不知道是怎磨個情況.