Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>HTML DOM Attributes</h1>
<h2>The specified Property</h2>
<div id="myDiv" style="background-color:red;width:50px;height:50px"></div>
<p>Is the style attribute specified?</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
document.getElementById("myDiv").getAttributeNode("style").specified;
</script>
</body>
</html>