Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. Web API
  3. Element
  4. ariaExpanded

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

Element: ariaExpanded プロパティ

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.

ariaExpandedElement インターフェイスのプロパティで、aria-expanded 属性の値を反映し、この要素が所有または制御するグループ化要素が展開されているか折りたたまれているかを示します。

以下のいずれかの値を持つ文字列です。

"true"

この要素が所有または制御しているグループ化要素が展開されています。

"false"

この要素が所有または制御しているグループ化要素が折り畳まれています。

"undefined"

この要素は展開されているグループ化要素を所有または制御していません。

この例では、ID がanimal の要素のaria-expanded 属性は "false" に設定されています。ariaExpanded を使用して、値を "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

仕様書

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

ブラウザーの互換性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp