Movatterモバイル変換


[0]ホーム

URL:


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

Element: ariaSelected 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.

TheariaSelected property of theElement interface reflects the value of thearia-selected attribute, which indicates the current "selected" state of elements that have a selected state.

Value

A string with one of the following values:

"true"

The item is selected.

"false"

The item is not selected.

"undefined"

The item is not selectable.

Examples

In this example thearia-selected attribute on the element with an ID oftab-id is set to "true". UsingariaSelected we update the value to "false".

html
<button role="tab" aria-selected="true" aria-controls="tabpanel-id">  Tab label</button>
js
let el = document.getElementById("tab-id");console.log(el.ariaSelected); // trueel.ariaSelected = "false";console.log(el.ariaSelected); // false

Specifications

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

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp