Easy Tutorial
❮ Dom Obj Table Met Canvas Beziercurveto ❯

CSSStyleDeclaration getPropertyPriority() Method

CSS CSSStyleDeclaration

Example

Returns whether the color property has "important!" priority set:

var declaration = document.styleSheets[0].cssRules[0].style;
var priority = declaration.getPropertyPriority("color");
alert(priority);

Definition and Usage

The getPropertyPriority() method returns whether the specified CSS property has "important!" priority set. If it returns "important", it indicates that the priority is set; otherwise, it is not.


Browser Support

Method Chrome IE Firefox Safari Opera
getPropertyPriority() Yes 9.0 Yes Yes Yes

Syntax

object.getPropertyPriority(propertyname)

Parameter Values

Parameter Description
propertyname Required. A string representing the property name to be checked.

Technical Details

DOM Version: CSS Object Model
Return Value: String, indicating the priority set, if empty then no priority is set.
--- ---

CSS CSSStyleDeclaration

❮ Dom Obj Table Met Canvas Beziercurveto ❯