The HTML aria-valuenow attribute
The aria-valuenow attribute reports the current numeric value of a range widget: a slider, spinbutton, scrollbar or progressbar. Pair it with aria-valuemin and aria-valuemax.
Overview
The aria-valuenow attribute declares the current value of a range widget such as a slider or progress bar.
It describes a range widget: a slider, progress bar or spin button (role="slider", "progressbar", "spinbutton"). Native <input type="range">, <progress> and <meter> elements expose their values automatically, so reach for these attributes only when building a custom widget.
Like all ARIA, aria-valuenow changes only the accessibility tree (what assistive technology perceives), never the element's behavior or appearance. The first rule of ARIA applies: if a native HTML element or attribute conveys this, use that instead, and only reach for ARIA when nothing native fits.
Syntax
<div role="slider" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40"></div>
Values
| Value |
|---|
| A number. |
Example
<div role="slider" aria-valuemin="0" aria-valuemax="10" aria-valuenow="7" tabindex="0"></div>
Best practices
- Omit
aria-valuenowon an indeterminate progress bar, one whose progress you can't measure, so nothing is implied about its current value. A native <progress> becomes indeterminate the same way, when its value attribute is left out. - A decimal such as 0.5 is fine, but a number outside the range set by aria-valuemin and aria-valuemax is invalid. Chrome exposes a slider set above its maximum as the maximum.
- Slider, scrollbar and meter roles require aria-valuenow, and so does a focusable separator, where it reports the divider's position between two resizable sections. On progressbar and spinbutton the attribute is optional.
- On a progressbar or scrollbar, WAI-ARIA 1.2 asks assistive technologies to present the value as a percent of the range, so 30 on a 0 to 60 bar should read as 50 percent. Slider and spinbutton values should be presented as numbers.
- Before building a
role="spinbutton"with aria-valuenow, try <input type="number">. Its value, min and max attributes carry the same information natively.























