-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
39 lines (27 loc) · 891 Bytes
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: "HTMLStyleElement: sheet property"
short-title: sheet
slug: Web/API/HTMLStyleElement/sheet
page-type: web-api-instance-property
browser-compat: api.HTMLStyleElement.sheet
---
{{APIRef("HTML DOM")}}
The read-only **`sheet`** property of the {{domxref("HTMLStyleElement")}} interface
contains the stylesheet associated with that element.
An {{DOMxref("StyleSheet")}} is always associated with a {{domxref("HTMLStyleElement")}}, unless its `type` attribute is not `text/css`.
## Value
A {{DOMxRef("StyleSheet")}} object, or `null` if none is associated with the element.
## Examples
```html
<html>
<header>
<style media="print" />
…
</header>
</html>
```
The `sheet` property of the associated `HTMLStyleElement` object will return the {{domxref("StyleSheet")}} object describing it.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}