ownerRule property (styleSheet)
Returns a CSSRule object that represents the rule that imported the current style sheet.
Note: The ownerRule property is supported in Internet Explorer from version 9.
- If the current stylesheet was imported by an @import style rule, then returns a CSSImportRule object that represents the @import style rule.
- If the current stylesheet belongs to a style element, or was imported by a link element, then returns null. In that case, use the ownerNode and owningElement properties to get the owner element.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Returns a reference to the owner CSSRule object or returns null.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the ownerRule property:
Did you find this example helpful?
User Contributed Comments