JavaScript Element ariaDisabled Property

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Baseline
Instance property

What You’ll Learn

Element.ariaDisabled is an instance property that reflects the aria-disabled attribute. Learn the "true" / "false" strings, when to prefer native disabled, and how to get or set the property from JavaScript—with five examples and try-it labs.

01

Kind

Instance property

02

Type

String

03

Values

"true" · "false"

04

Reflects

aria-disabled

05

Status

Baseline widely

06

Prefer native

button / input disabled

Introduction

A disabled control should still be visible (perceivable) but not operable—no clicks, no edits, no activation. Native form controls use the HTML disabled attribute for that.

Custom widgets that cannot use native disabled expose the same idea with aria-disabled. ariaDisabled is the JavaScript reflection of that attribute.

JavaScript
const el = document.getElementById("saveChanges");
console.log(el.ariaDisabled); // "true"
el.ariaDisabled = "false";
💡
Beginner tip

Prefer a real <button> or form control with HTML disabled when you can (MDN). Use ariaDisabled for custom widgets that cannot use the native attribute—and still block activation in script.

Understanding the Property

MDN: the ariaDisabled property of the Element interface reflects the value of the aria-disabled attribute, which indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.

  • Reflected attribute — mirrors aria-disabled.
  • Get / set — readable and writable string.
  • Two tokens"true" and "false".
  • Baseline — widely available since October 2023 (MDN).

📝 Syntax

JavaScript
ariaDisabled

Value

A string with one of the following values:

ValueMeaning (MDN)
"true"The element and all focusable descendants are disabled, but perceivable, and their values cannot be changed by the user.
"false"The element is enabled.

📋 Custom Save Button (MDN Shape)

MDN starts with a custom button marked disabled, then enables it with ariaDisabled:

JavaScript
<div id="saveChanges" tabindex="0" role="button" aria-disabled="true">
  Save
</div>
JavaScript
let el = document.getElementById("saveChanges");
console.log(el.ariaDisabled); // "true"
el.ariaDisabled = "false";
console.log(el.ariaDisabled); // "false"

When ariaDisabled is "true", also prevent click / Enter / Space handlers and apply disabled styling so the UI matches what assistive technologies hear.

⚖️ Native disabled vs aria-disabled

HTML disabledaria-disabled
Best on<button>, inputs, selects, …Custom widgets without native disabled
Built-in behaviorBrowser blocks activationYou must block activation in script
FocusTypically not focusable when disabledOften still focusable (perceivable)
MDN advicePrefer when possibleUse only when needed

⚡ Quick Reference

GoalCode / note
Readel.ariaDisabled
Disableel.ariaDisabled = "true"
Enableel.ariaDisabled = "false"
Prefer nativebutton.disabled = true when possible
MDN statusBaseline Widely available

🔍 At a Glance

Four facts about Element.ariaDisabled.

Kind
get / set

Instance

Type
string

true / false

Reflects
aria-disabled

Attribute

Baseline
widely

Oct 2023+

Examples Gallery

Examples follow MDN Element: ariaDisabled. Labs use a custom role="button" widget so you can safely read and write the property.

📚 Getting Started

Read the reflected value and follow MDN’s enable update.

Example 1 — Read ariaDisabled

Log the current disabled state from a custom button.

JavaScript
const el = document.getElementById("saveChanges");
console.log(el.ariaDisabled);

// HTML includes: aria-disabled="true"
Try It Yourself

How It Works

The property returns the attribute string. If the attribute is missing, many browsers return null.

Example 2 — MDN Update to "false"

MDN: change from disabled to enabled.

JavaScript
let el = document.getElementById("saveChanges");
console.log(el.ariaDisabled); // true
el.ariaDisabled = "false";
console.log(el.ariaDisabled); // false
Try It Yourself

How It Works

Assigning the property updates the reflected aria-disabled attribute so assistive technologies see the new state.

📈 Toggle, Attribute Sync & Snapshot

Practice enable/disable cycles and verify reflection.

Example 3 — Toggle Disabled State

Flip between "true" and "false".

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

function setDisabled(on) {
  el.ariaDisabled = on ? "true" : "false";
  // Also block handlers + update CSS when on === true
}

setDisabled(true);
console.log("after disable:", el.ariaDisabled);
setDisabled(false);
console.log("after enable:", el.ariaDisabled);
Try It Yourself

How It Works

Keep visuals and event handlers in sync with the string you set—ARIA alone does not stop clicks on a custom widget.

Example 4 — Property vs getAttribute

Confirm the attribute stays in sync after a write.

JavaScript
const el = document.createElement("div");
el.setAttribute("role", "button");
el.setAttribute("aria-disabled", "true");
document.body.appendChild(el);

el.ariaDisabled = "false";
console.log({
  fromProperty: el.ariaDisabled,
  fromAttribute: el.getAttribute("aria-disabled"),
  same: el.ariaDisabled === el.getAttribute("aria-disabled")
});
Try It Yourself

How It Works

Prefer ariaDisabled in script; keep the attribute for HTML markup.

Example 5 — Support Snapshot

Feature-detect and remember the prefer-native rule.

JavaScript
console.log({
  supported: "ariaDisabled" in Element.prototype,
  allowed: ["true", "false"],
  tip: "Prefer native button/input disabled when possible (MDN)",
  status: "Baseline Widely available (MDN)"
});
Try It Yourself

How It Works

Use string tokens, not boolean literals, and keep behavior aligned with the disabled state you announce.

🚀 Common Use Cases

  • Custom buttons that cannot use HTML disabled.
  • Composite widgets where a region is temporarily inoperable but still visible.
  • Enabling a Save / Submit control after form validation.
  • Keeping script and markup aligned without manual setAttribute.
  • Teaching the difference between native disabled and ARIA disabled.

🔧 How It Works

1

UI should become inoperable

Validation pending, permission missing, or loading.

Need
2

Prefer native disabled when possible

Use button.disabled / HTML disabled.

Native
3

Or set ariaDisabled on a custom widget

Assign "true" / "false" and block handlers.

ARIA
4

Users and AT see a consistent state

Visible but inoperable when disabled; operable when enabled.

📝 Notes

Browser Support

Element.ariaDisabled is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.

Baseline Widely available

Element.ariaDisabled

String true / false — reflects aria-disabled.

Baseline Widely available
Google Chrome Supported (ARIA reflection)
Yes
Microsoft Edge Supported (ARIA reflection)
Yes
Mozilla Firefox Supported (ARIA reflection)
Yes
Apple Safari Supported (ARIA reflection)
Yes
Opera Follow Chromium support
Yes
Internet Explorer No ariaDisabled IDL — use setAttribute
No
ariaDisabled Baseline

Bottom line: Use ariaDisabled to get/set aria-disabled on custom widgets. Prefer native disabled when possible. Keep visuals and event handlers in sync with the token you set.

Conclusion

ariaDisabled reflects aria-disabled so custom widgets can expose a perceivable-but-disabled state with "true" and "false". Prefer native disabled when you can; when you use ARIA, keep styling and activation logic aligned with the property.

Continue with ariaErrorMessageElements, ariaDetailsElements, EventTarget, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Prefer native disabled on buttons and inputs
  • Use string tokens: "true" / "false"
  • Block click / keyboard activation when disabled
  • Match disabled styling to the ARIA state
  • Keep the control perceivable (visible) when disabled via ARIA

❌ Don’t

  • Rebuild native buttons with ARIA without need
  • Assume ARIA alone stops mouse and keyboard events
  • Assign boolean true / false expecting ARIA strings
  • Hide the control completely when you only mean “disabled”
  • Forget focusable descendants when setting "true"

Key Takeaways

Knowledge Unlocked

Five things to remember about ariaDisabled

Reflected aria-disabled string for custom disabled widgets.

5
Core concepts
📝 02

Two values

true · false

Tokens
🔍 03

Perceivable

but not operable

Meaning
04

Baseline

widely available

Status
🎯 05

Prefer native

HTML disabled

Rule

❓ Frequently Asked Questions

It reflects the aria-disabled attribute as a string ("true" or "false"), indicating the element is perceivable but disabled—so it is not editable or otherwise operable.
No. MDN marks Element.ariaDisabled as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
The strings "true" (disabled but still perceivable) or "false" (enabled).
In JavaScript you assign the strings "true" and "false", not the boolean literals true/false. The property reflects the ARIA attribute value.
Yes when possible. Prefer <button> or form controls with the HTML disabled attribute—they have built-in semantics and do not require ARIA (MDN).
Yes. Reading and writing ariaDisabled updates the reflected aria-disabled attribute. Also block activation and match disabled styling when you set "true".
Did you know?

Unlike HTML disabled (which often removes the control from tab order), aria-disabled="true" usually keeps the element focusable so users can still discover it—while your script must prevent it from doing anything.

Next: Element ariaErrorMessageElements

Learn the reflected aria-errormessage element-array property for form validation errors.

ariaErrorMessageElements →

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.

5 people found this page helpful