Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Accessibility
  3. ARIA
  4. ARIA reference
  5. Attributes
  6. aria-checked

ARIA: aria-checked attribute

Thearia-checked attribute indicates the current "checked" state of checkboxes, radio buttons, and other widgets.

Note:Where possible use an HTML<input> element withtype="checkbox" andtype="radio" as these have built in semantics and do not require ARIA attributes.

Description

Thearia-checked attribute indicates whether the element is checked (true), unchecked (false), or if the checked status is indeterminate (mixed), meaning it is neither checked nor unchecked. Themixed value is supported by the tri-state input roles ofcheckbox andmenuitemcheckbox.

Themixed value is not supported onradio,menuitemradio, orswitch and elements that inherits from these. The value will be false ifmixed is set when not supported.

html
<span  role="checkbox"   aria-checked="false"  tabindex="0"  aria-labelledby="chk15-label"></span><label>Subscribe to the newsletter</label>

Thetabindex attribute is required to enable focus. JavaScript is required to toggle thearia-checked state. And, if this checkbox is part of a submittable form, more JavaScript is required to set a name and a value.

The above could have been written as:

html
<input type="checkbox" name="Subscribe" /><label for="chk15-label">Subscribe to the newsletter</label>

By using the<input> element withtype="checkbox" instead of ARIA, there is no need for any JavaScript.

Values

false

The element supports being checked but is not currently checked.

true

The element is checked.

mixed

forcheckbox andmenuitemcheckbox only, equivalent toindeterminate, indicating a mixed mode value of neither checked nor unchecked.

undefined (default)

The element does not support being checked.

Associated roles

Used in roles:

Associated interfaces

Element.ariaChecked

TheariaChecked property, part of theElement interface, reflects the value of thearia-checked attribute.

ElementInternals.ariaChecked

TheariaChecked property, part of theElementInternals interface, reflects the value of thearia-checked attribute.

js
myHTMLElement.ariaChecked = true;

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# aria-checked
Unknown specification

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp