Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSSStyleDeclaration getPropertyPriority() method

CSSStyleDeclaration getPropertyPriority() method

CSS CSSStyleDeclaration CSS CSSStyleDeclaration

Example

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

var

declaration

=

document

.

styleSheets

[

0

]

.

cssRules

[

0

]

.

style

;

var

priority

=

declaration

.

getPropertyPriority

(

"

color

"

)

;

alert

(

priority

)

;

Try it »


Definition and usage

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


Browser support

Method
getPropertyPriority() Yes 9.0 Yes Yes Yes

Syntax



object.getPropertyPriority(propertyname)


Attribute values

Parameters Description
propertyname Required. A string representing the name of the property to check.

Technical Details

DOM version: CSS Object Model
Return value: A string indicating that the priority is set; if empty, it means the priority is not set.

CSS CSSStyleDeclaration CSS CSSStyleDeclaration