CSSStyleDeclaration getPropertyPriority() method
Definition and Usage
getPropertyPriority()
The method returns whether the specified CSS property has an "important!" priority setting.
If this method returns "important!", an important qualifier is set.
If this method returns an empty string, no important qualifier is set.
Example
Return whether the color property has an "important!" priority setting:
var declaration = document.styleSheets[0].cssRules[0].style; var priority = declaration.getPropertyPriority("color"); alert(priority);
syntax
object.getPropertyPriority()propertyname)
Parameters
Parameters | Description |
---|---|
propertyname | Required. String, representing the name of the property to check. |
Technical Details
DOM Version: | CSS Object Model |
---|---|
Return Value: | String representing the priority, if not present, it is an empty string. |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 9.0 | Support | Support | Support |