Baseline Widely available
The selectorText
property of the CSSStyleRule
interface gets and sets the selectors associated with the CSSStyleRule
.
A string.
ExamplesThe CSS includes one style rule. This will be the first CSSRule
returned by document.styleSheets[0].cssRules
. myRules[0].selectorText
therefore returns a literal string of the selector, in this case "h1"
.
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].selectorText); // a string containing "h1".
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4