JavaScript Element ariaValueMax Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

Element.ariaValueMax reflects the aria-valuemax attribute: the maximum allowed value for a range widget such as a slider, scrollbar, or spinbutton (MDN). The value is a string number (integer or decimal).

Read the notes below before you get or set this property. Prefer feature detection when support is limited.

Syntax

Use el.ariaValueMax. Start with this line.

JavaScript
el.ariaValueMax / el.ariaValueMax = value
CallWhat it does
el.ariaValueMax / el.ariaValueMax = valuePrimary signature.

Built into the browser. Read or assign el.ariaValueMax — no import required.

Library declarations
JavaScript
el.ariaValueMax / el.ariaValueMax = value

Parameters

ParameterDescription
Range widgetRequired. slider / scrollbar / spinbutton / meter…
String numberRequired. Maximum; must be > min

Return Value

Return ValueDescription
*The current value of el.ariaValueMax.

JavaScript Examples

Example 1 — Read ariaValueMax

Log the maximum from a day-of-week slider.

JavaScript
const el = document.getElementById("slider");
console.log(el.ariaValueMax); // "7"

// HTML: role="slider" aria-valuemax="7" …
Try It Yourself

How It Works

  1. Find the slider. getElementById returns the range widget node.
  2. Read the reflection. ariaValueMax returns the aria-valuemax string.
  3. Interpret "7". Assistive technologies treat 7 as the top of the range.
  4. Missing attribute. If unset, many browsers return null.

Example 2 — Update the Maximum (MDN)

MDN: change the reported max from "7" to "6".

JavaScript
const el = document.getElementById("slider");

console.log(el.ariaValueMax); // "7"
el.ariaValueMax = "6";
console.log(el.ariaValueMax); // "6"
console.log(el.getAttribute("aria-valuemax")); // "6"
Try It Yourself

How It Works

  1. Start at 7. The first log shows the initial maximum.
  2. Assign a string. el.ariaValueMax = "6" updates the reflected attribute.
  3. Confirm both sides. Property and getAttribute both report "6".
  4. After changing max. If ariaValueNow is above the new max, clamp it down.

Example 3 — Keep ariaValueNow in Range

When lowering the max, clamp the current value so it stays valid.

JavaScript
const el = document.getElementById("slider");
const max = 5;

el.ariaValueMax = String(max);
let now = Number(el.ariaValueNow);
if (now > max) {
  el.ariaValueNow = String(max);
}

console.log(el.ariaValueMax); // "5"
console.log(el.ariaValueNow); // "5" (clamped from 7)
Try It Yourself

How It Works

  1. Lower the ceiling. Set ariaValueMax to "5".
  2. Read the current value. Convert ariaValueNow with Number(...).
  3. Clamp if needed. If now is above max, write max back to ariaValueNow.
  4. Why it matters. A current value above the maximum confuses assistive technologies.

Browser Support

Element.ariaValueMax is Baseline Widely available (MDN: across browsers since October 2023).

✓ Baseline · Widely available

Element.ariaValueMax

Supported in modern Chromium, Firefox, Safari, and Edge. Internet Explorer has no ariaValueMax IDL — use getAttribute / setAttribute there.

95% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Android WebView Supported · Modern WebView
Full support
Element.ariaValueMax Excellent

Bottom line: Safe for modern web apps. Prefer native max when you can; for custom widgets keep min, max, and now consistent.

Frequently Asked Questions

It reflects the aria-valuemax attribute as a string number that defines the maximum allowed value for a range widget such as a slider, scrollbar, spinbutton, meter, or progressbar.
No. MDN marks Element.ariaValueMax as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string containing a number (integer or decimal), and it must be greater than the minimum value (aria-valuemin).
MDN lists it as required for slider, scrollbar, and spinbutton. It is also used on meter, separator, and progressbar-related range widgets.
No. MDN warns that the abstract range role should not be used. Use a concrete subtype such as slider, scrollbar, or spinbutton.
On native <input type="range">, <progress>, or <meter>, prefer the HTML max attribute. Use aria-valuemax when you build a custom range widget with ARIA roles.

Next: ariaValueMin

Learn the reflected aria-valuemin property for the minimum of range widgets like sliders and progress bars.

ariaValueMin tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful