CSSRule: parentStyleSheet property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ APIRef("CSSOM") }}

The **parentStyleSheet** read-only property of the {{domxref("CSSRule")}} interface returns the {{domxref("StyleSheet")}} object in which the current rule is defined.

Value

A {{domxref("StyleSheet")}} object.

Examples

js
const docRules = document.styleSheets[0].cssRules;
console.log(docRules[0].parentStyleSheet === document.styleSheets[0]); // returns true

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}