Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!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>