CSSRule.parentStyleSheet

parentStyleSheet returns the stylesheet object in which the current rule is defined.

Syntax

JavaScript
var stylesheet = cssRule.parentStyleSheet 

Parameters

  • stylesheet is a stylesheet object.

Example

JavaScript
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

API CSSOM NeedsCompatTable NeedsMarkupWork NeedsSpecTable Property Reference