Movatterモバイル変換


[0]ホーム

URL:


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

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

TheariaExpanded property of theElement interface reflects the value of thearia-expanded attribute, which indicates whether a grouping element owned or controlled by this element is expanded or collapsed.

Value

A string with one of the following values:

"true"

The grouping element this element owns or controls is expanded.

"false"

The grouping element this element owns or controls is collapsed.

"undefined"

The element does not own or control a grouping element that is expandable.

Examples

In this example thearia-expanded attribute on the element with an ID ofanimal is set to "false". UsingariaExpanded we update the value to "true".

html
<div>  <label for="animal">Animal</label>  <input       type="text"    role="combobox"    aria-autocomplete="list"    aria-expanded="false"    aria-haspopup="true" />  <button tabindex="-1" aria-label="Open">▽</button>  <ul role="listbox" aria-label="Animals">    <li role="option">Cat</li>    <li role="option">Dog</li>  </ul></div>
js
let el = document.getElementById("animal");console.log(el.ariaExpanded); // falseel.ariaExpanded = "true";console.log(el.ariaExpanded); // true

Specifications

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

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp