<!DOCTYPE html>
<html>
<head>
<style>
#ex1 {
color: red !important;
}
</style>
</head>
<body>
<h1>The getPropertyPriority() Method</h1>
<p>Click the button to return whether or not the color property has the "important!" priority set.</p>
<button onclick="myFunction()">Try it</button>
<div id="ex1">Some text.</div>
<script>
function myFunction() {
var declaration = document.styleSheets[0].cssRules[0].style;
var priority = declaration.getPropertyPriority("color");
alert(priority);
}
</script>
</body>
</html>