CSSRule.parentStyleSheet
parentStyleSheet returns the stylesheet object in which the current rule is defined.
Syntax
JavaScript
Copy Code
var stylesheet = cssRule.parentStyleSheet
Parameters
stylesheet
is a stylesheet object.
Example
JavaScript
Copy Code
if ( bgRule.parentStyleSheet != mySheet ) { // alien style rule! }
Notes
See Gecko DOM Reference:event#DOM_styleSheet_Object for more information about the stylesheet object interface.
Specification
DOM Level 2 Style - cssRule
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/cssrule/parentstylesheet