<html>
<head>
<style>
#ex1 {
color: red;
}
</style>
</head>
<body>
<h1>The setProperty() Method</h1>
<p>Click the button to set a new CSS property.</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");
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_cssstyle_setproperty by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:00:19 GMT -->
</html>