<html>
<head>
<style>
#ex1 {
color: red;
}
</style>
</head>
<body>
<h1>The setProperty() Method</h1>
<p>Click the button to set a new CSS property with "important" priority.</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 setprop = declaration.setProperty("background-color", "yellow", "important");
}
</script>
</body>
</html>