Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Element
  4. ariaChecked

Element: ariaChecked property

Baseline 2023
Newly available

Since ⁨October 2023⁩, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

TheariaChecked property of theElement interface reflects the value of thearia-checked attribute, which indicates the current "checked" state of checkboxes, radio buttons, and other widgets that have a checked state.

Note:Where possible use an HTML<input> element withtype="checkbox" as this element has built in semantics and does not require ARIA attributes.

Value

A string with one of the following values:

"true"

The element is checked.

"mixed"

Indicates a mixed mode value for a tri-state checkbox or menuitemcheckbox.

"false"

The element supports being checked but is not currently checked.

"undefined"

The element does not support being checked.

Examples

In this example thearia-checked attribute on the element with an ID ofcheckBoxInput is set to "false" indicating that this input is currently unchecked. UsingariaChecked we update the value to "true".

html
<span  role="checkbox"   aria-checked="false"  tabindex="0"  aria-labelledby="chk1-label"></span><label>Remember my preferences</label>
js
let el = document.getElementById("checkBoxInput");console.log(el.ariaChecked); // "false"el.ariaChecked = "true";console.log(el.ariaChecked); // "true"

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariachecked

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp