You are here: Reference > JavaScript > client-side > style handling > methods > getPropertyPriority

getPropertyPriority method

Browser support:
Retrieves the priority of specified style property (the 'important' qualifier).
Note: The getPropertyValue method is supported in Internet Explorer from version 9.
The important qualifier can be set for a style property in CSS, or by the setProperty method.


object.getPropertyPriority ( );
You can find the related objects in the Supported by objects section below.

Return value:

String. One of the following values:
important Important qualifier is set.
empty string Important qualifier is not set.

Example HTML code 1:

This example illustrates the use of the getPropertyPriority method:
        #myDiv {
            width:200px !important;
    <script type="text/javascript">
        function GetPriority () {
            var sheet = document.styleSheets[0];
            var rules = sheet.cssRules ? sheet.cssRules : sheet.rules;
            var rule = rules[0];

            if ( {
                var priority = ("width");
                alert (priority);
            else {      // Internet Explorer before version 9
                alert ("Your browser does not support this example!");
    <div id="myDiv">A div element</div>
    <button onclick="GetPriority ()">Get priority!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content