<html>
<body>
<h1>HTML DOM Attributes</h1>
<h2>specified 属性</h2>
<div id="myDiv" style="background-color:red;width:50px;height:50px"></div>
<p>是否指定了 style 属性?</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
document.getElementById("myDiv").getAttributeNode("style").specified;
</script>
</body>
</html>