The parentStyleSheet
property of the
CSSRule
interface returns the StyleSheet
object in which
the current rule is defined.
Syntax
var stylesheet = cssRule.parentStyleSheet
Values
stylesheet
- A
StyleSheet
object.
Example
let myRules = document.styleSheets[0].cssRules;
console.log(myRules.parentStyleSheet);
Specifications
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) The definition of 'CSSRule: parentStyleSheet' in that specification. |
Working Draft |
Browser compatibility
BCD tables only load in the browser