-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
45 lines (32 loc) · 1.31 KB
/
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
40
41
42
43
44
45
---
title: "Element: ariaHidden property"
short-title: ariaHidden
slug: Web/API/Element/ariaHidden
page-type: web-api-instance-property
browser-compat: api.Element.ariaHidden
---
{{DefaultAPISidebar("DOM")}}
The **`ariaHidden`** property of the {{domxref("Element")}} interface reflects the value of the [`aria-hidden`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden)) attribute, which indicates whether the element is exposed to an accessibility API.
## Value
A string with one of the following values:
- `"true"`
- : The element is hidden from the accessibility API.
- `"false"`
- : The element is exposed to the accessibility API as if it were rendered.
- `"undefined"`
- : The element's hidden state is determined by the user agent based on whether it is rendered.
## Examples
In this example the [`aria-hidden`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden) attribute on the element with an ID of `hidden` is set to "true". Using `ariaHidden` we update the value to "false".
```html
<div id="hidden" aria-hidden="true">Some things are better left unsaid.</div>
```
```js
let el = document.getElementById("hidden");
console.log(el.ariaHidden); // true
el.ariaHidden = "false";
console.log(el.ariaHidden); // false
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}