Example 1 — Read ariaValueMax
Log the maximum from a day-of-week slider.
const el = document.getElementById("slider");
console.log(el.ariaValueMax); // "7"
// HTML: role="slider" aria-valuemax="7" … How It Works
- Find the slider.
getElementByIdreturns the range widget node. - Read the reflection.
ariaValueMaxreturns thearia-valuemaxstring. - Interpret
"7". Assistive technologies treat 7 as the top of the range. - Missing attribute. If unset, many browsers return
null.

