Baseline Widely available
The read-only sheet
property of the HTMLStyleElement
interface contains the stylesheet associated with that element.
An StyleSheet
is always associated with a HTMLStyleElement
, unless its type
attribute is not text/css
.
A StyleSheet
object, or null
if none is associated with the element.
Suppose the <head>
contains the following:
<style id="inline-style">
p {
color: blue;
}
</style>
The sheet
property of the associated HTMLStyleElement
object will return the StyleSheet
object describing it.
const style = document.getElementById("inline-style");
console.log(style.sheet.cssRules[0].cssText); // 'p { color: blue; }'
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