CSSStyleDeclaration getPropertyPriority() Method

❮ CSSStyleDeclaration Object

Example

Return whether or not 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 Yourself »

Description

The getPropertyPriority() method returns whether or not the specified CSS property has the "important!" priority set.

If this method returns "important", the important qualifier is set.

If this method returns an empty string, the important qualifier is not set.


Browser Support

Method
getPropertyPriority() Yes 9.0 Yes Yes Yes

Syntax

object.getPropertyPriority(propertyname)

Parameter Values

Parameter Description
propertyname Required. A String representing the name of the property to check

Technical Details

DOM Version: CSS Object Model
Return Value: A String, representing the priority, or an empty string if it does not exists

❮ CSSStyleDeclaration Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.