This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

ownerRule

Summary

Gets the CSS Rule that imported the style sheet, if any.

Property of css/cssom/styleSheetcss/cssom/styleSheet

Syntax

Note: This property is read-only.

var rule = stylesheet.ownerRule;

Return Value

Returns an object of type DOM NodeDOM Node

Of type CSSRule. Returns a CSSImportRule or null.

Notes

If the style sheet comes from an @import rule, the ownerRule property will contain a CSSImportRule object, and the ownerNode property will be null. If the style sheet comes from a link, the ownerRule property will be null, and the ownerNode will contain the node.

Related specifications

DOM Level 2 Style
Recommendation

See also

Related pages

Attributions