-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
44 lines (32 loc) · 1.1 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
---
title: "Element: ariaValueText property"
short-title: ariaValueText
slug: Web/API/Element/ariaValueText
page-type: web-api-instance-property
browser-compat: api.Element.ariaValueText
---
{{DefaultAPISidebar("DOM")}}
The **`ariaValueText`** property of the {{domxref("Element")}} interface reflects the value of the [`aria-valuetext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext) attribute, which defines the human-readable text alternative of aria-valuenow for a range widget.
## Value
A string.
## Examples
In this example the `aria-valuetext` attribute on the element with an ID of `slider` is set to "Sunday" to give a human-readable value for the range. Using `ariaValueText` we update the value to "Monday".
```html
<div
id="slider"
role="slider"
aria-valuenow="1"
aria-valuemin="1"
aria-valuemax="7"
aria-valuetext="Sunday"></div>
```
```js
let el = document.getElementById("slider");
console.log(el.ariaValueText); // Sunday
el.ariaValueText = "Monday";
console.log(el.ariaValueText); // Monday
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}