Example 1 — Read ariaValueNow
Log the current value from a day-of-week slider.
const el = document.getElementById("slider");
console.log(el.ariaValueNow); // "1"
// HTML: role="slider" aria-valuenow="1" … How It Works
- Find the slider.
getElementByIdreturns the range widget node. - Read the reflection.
ariaValueNowreturns thearia-valuenowstring. - Interpret
"1". Assistive technologies treat 1 as the current value. - Missing attribute. If unset, many browsers return
null(no known value).

