A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/css/cssom/CSSStyleDeclaration/getPropertyPriority below:

getPropertyPriority ยท WebPlatform Docs

getPropertyPriority Summary

Gets the priority of a property in a CSS style declaration.

Method of css/cssom/CSSStyleDeclaration/CSSStyleDeclarationcss/cssom/CSSStyleDeclaration/CSSStyleDeclaration

Syntax
var priority = declaration.getPropertyPriority(property);
Parameters property
Data-type
String

The name of the CSS property.

Return Value

Returns an object of type StringString

A string that represents the priority if the property is explicitly set in this declaration block and has a specified priority specified, or null.

Examples

Gets the priority of the first rule in the stylesheet.

<head>
<style>
#aDiv {
    width:200px !important;
}
</style>
<script type="text/javascript">
var rule = document.styleSheets[0].cssRules[0];
var priority = rule.style.getPropertyPriority ("width");
alert (priority);
</script>
</head>

<body>
<div id="aDiv">This is a div.</div>
</body>
Notes

The priority of a CSS property is designated by, for example, the !important declaration.

Related specifications
DOM Level 2 Style
Recommendation
See also Related articles CSSOM Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4