Example 1 — Read ariaValueText
Log the friendly label from a day-of-week slider.
const el = document.getElementById("slider");
console.log(el.ariaValueText); // "Sunday"
// HTML: aria-valuetext="Sunday" aria-valuenow="1" How It Works
- Find the slider.
getElementByIdreturns the range widget node. - Read the reflection.
ariaValueTextreturns thearia-valuetextstring. - Interpret
"Sunday". Assistive technologies can announce the day name instead of"1". - Missing attribute. If unset, many browsers return
nulland AT falls back toariaValueNow.

