JavaScript Element ariaChecked Property

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

What You’ll Learn

Element.ariaChecked is an instance property that reflects the aria-checked attribute. Learn the true, mixed, false, and undefined values, when to prefer a native checkbox, 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 · mixed · false · undefined

04

Reflects

aria-checked

05

Status

Baseline widely

06

Used on

Checkbox / radio widgets

Introduction

Custom checkboxes, radios, and menu items need a clear checked state for assistive technologies. That state is what aria-checked communicates.

The DOM property ariaChecked lets you read and update the same value from JavaScript—useful when you toggle a custom widget with script.

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

Prefer a native <input type="checkbox"> when you can. It already exposes checked state without ARIA. Use ariaChecked for custom widgets that cannot use the native control.

Understanding the Property

MDN: the ariaChecked property of the Element interface reflects the value of the aria-checked attribute, which indicates the current “checked” state of checkboxes, radio buttons, and other widgets that have a checked state.

  • Reflected attribute — mirrors aria-checked.
  • Get / set — readable and writable string.
  • Four tokenstrue, mixed, false, undefined.
  • Baseline — widely available since October 2023 (MDN).

📝 Syntax

JavaScript
ariaChecked

Value

A string with one of the following values:

ValueMeaning (MDN)
"true"The element is checked.
"mixed"Mixed / tri-state value for a checkbox or menuitemcheckbox.
"false"Supports being checked but is not currently checked.
"undefined"The element does not support being checked.

📋 Custom Checkbox (MDN Shape)

MDN starts with an unchecked custom checkbox (aria-checked="false"), then updates to "true" with the property:

JavaScript
<span
  role="checkbox"
  id="checkBoxInput"
  aria-checked="false"
  tabindex="0"
  aria-labelledby="chk1-label">
</span>
<label id="chk1-label">Remember my preferences</label>

Also wire keyboard activation (Space / Enter) and visible checked styling so the control matches what ariaChecked reports.

⚡ Quick Reference

GoalCode / note
Readel.ariaChecked
Checkel.ariaChecked = "true"
Uncheckel.ariaChecked = "false"
Tri-stateel.ariaChecked = "mixed"
Prefer native<input type="checkbox"> when possible
MDN statusBaseline Widely available

🔍 At a Glance

Four facts about Element.ariaChecked.

Kind
get / set

Instance

Type
string

4 tokens

Reflects
aria-checked

Attribute

Baseline
widely

Oct 2023+

Examples Gallery

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

📚 Getting Started

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

Example 1 — Read ariaChecked

Log the current checked state from a custom checkbox.

JavaScript
const el = document.getElementById("checkBoxInput");
console.log(el.ariaChecked);

// HTML includes: aria-checked="false"
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 "true"

MDN: change from unchecked to checked.

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

How It Works

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

📈 Mixed, Attribute Sync & Snapshot

Practice tri-state values and verify reflection.

Example 3 — Set "mixed"

Represent a tri-state / indeterminate parent checkbox.

JavaScript
const parent = document.createElement("span");
parent.setAttribute("role", "checkbox");
parent.setAttribute("aria-checked", "false");
document.body.appendChild(parent);

parent.ariaChecked = "mixed";
console.log({
  ariaChecked: parent.ariaChecked,
  attr: parent.getAttribute("aria-checked")
});
Try It Yourself

How It Works

Use "mixed" only for true tri-state widgets (for example some-but-not-all children selected). Match the visual indeterminate style too.

Example 4 — Property vs getAttribute

Confirm the attribute stays in sync after a write.

JavaScript
const el = document.createElement("span");
el.setAttribute("role", "checkbox");
el.setAttribute("aria-checked", "false");
document.body.appendChild(el);

el.ariaChecked = "true";
console.log({
  fromProperty: el.ariaChecked,
  fromAttribute: el.getAttribute("aria-checked"),
  same: el.ariaChecked === el.getAttribute("aria-checked")
});
Try It Yourself

How It Works

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

Example 5 — Support Snapshot

Feature-detect and list the allowed tokens.

JavaScript
console.log({
  supported: "ariaChecked" in Element.prototype,
  allowed: ["true", "mixed", "false", "undefined"],
  tip: "Prefer native type=checkbox when possible (MDN)",
  status: "Baseline Widely available (MDN)"
});
Try It Yourself

How It Works

Keep visual state, keyboard behavior, and ariaChecked aligned whenever the user toggles the control.

🚀 Common Use Cases

  • Custom checkbox widgets built with role="checkbox".
  • Radio-like widgets that expose a checked state via ARIA.
  • Tri-state parent checkboxes with "mixed".
  • Menu item checkboxes (menuitemcheckbox).
  • Keeping script and markup aligned without manual setAttribute.

🔧 How It Works

1

User activates the widget

Click, Space, or Enter on a custom checkbox.

Input
2

Script updates ariaChecked

Toggle true / false (or mixed for tri-state).

State
3

Visual UI matches the token

Checked, unchecked, or indeterminate styling.

UI
4

Assistive tech announces the state

Screen readers report checked / unchecked / mixed.

📝 Notes

  • Not Deprecated, Experimental, or Non-standard on MDN (Baseline Widely available).
  • Values are strings: true, mixed, false, undefined.
  • Prefer native type="checkbox" when possible (MDN).
  • Related: ariaColCount, ariaBusy, EventTarget, JavaScript hub.

Browser Support

Element.ariaChecked 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.ariaChecked

String true / mixed / false / undefined — reflects aria-checked.

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 ariaChecked IDL — use setAttribute
No
ariaChecked Baseline

Bottom line: Use ariaChecked to get/set aria-checked on custom checkable widgets. Prefer native checkboxes when possible. Keep visual state and keyboard behavior in sync with the token you set.

Conclusion

ariaChecked reflects aria-checked so custom checkboxes, radios, and related widgets can expose checked, unchecked, mixed, or unsupported states. Prefer native checkboxes when you can; when you build a custom control, keep the property, visuals, and keyboard behavior aligned.

Continue with ariaColCount, ariaBusy, EventTarget, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Prefer native type="checkbox" when possible
  • Use string tokens: true / mixed / false / undefined
  • Sync visuals and keyboard with ariaChecked
  • Use "mixed" only for real tri-state cases
  • Provide an accessible name (label / labelledby)

❌ Don’t

  • Rebuild native checkboxes with ARIA without need
  • Forget to update the property when the UI toggles
  • Use "mixed" as a fancy checked style
  • Assign boolean true / false expecting ARIA strings
  • Skip focusability (tabindex) on custom widgets

Key Takeaways

Knowledge Unlocked

Five things to remember about ariaChecked

Reflected aria-checked string for checkable widgets.

5
Core concepts
📝 02

Four values

true mixed false undefined

Tokens
🔍 03

Custom widgets

checkbox / radio

Use
04

Baseline

widely available

Status
🎯 05

Prefer native

type=checkbox

Rule

❓ Frequently Asked Questions

It reflects the aria-checked attribute as a string, indicating the checked state of checkboxes, radio buttons, and other widgets that support a checked state.
No. MDN marks Element.ariaChecked as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
One of the strings "true", "mixed", "false", or "undefined".
Yes when possible. MDN recommends an HTML input with type="checkbox" because it has built-in semantics and does not require ARIA attributes.
A tri-state / indeterminate value for a checkbox or menuitemcheckbox — neither fully checked nor unchecked (for example a parent checkbox with some children selected).
Yes. Reading and writing ariaChecked updates the reflected aria-checked attribute.
Did you know?

The string "undefined" is a real ARIA token meaning “does not support being checked”—it is not the same as JavaScript’s undefined value when the attribute is missing.

Next: Element ariaColCount

Learn the reflected aria-colcount property for tables, grids, and treegrids.

ariaColCount →

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