English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript CSSStyleDeclaration Object
parentRuleThe property returns a CSSRule object that represents a CSS rule set (selector and declaration block).
styles.parentRule
var declaration = document.styleSheets[0].rules[0].style; var rule = declaration.parentRule; document.getElementById("result").innerHTML = rule.cssText;Test See‹/›
All browsers fully support the parentRule property:
Property | |||||
parentRule | Yes | Yes | Yes | Yes | Yes |
Return Value: | Contains the CSS rules of this declaration block |
---|---|
DOM Version: | CSS Object Model |