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

View in English Always switch to English

Element: ariaDescription プロパティ

Baseline
広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2024年3月以降、すべてのブラウザーで利用可能です。

ariaDescriptionElement インターフェイスのプロパティで、aria-description 属性の値を反映し、この属性は、現在の要素を記述したり、注釈を付けたりする文字列値を定義します。

文字列です。

この例では、ID が close-button の要素の aria-description 属性に文字列 "A longer description of the function of this element" が設定されています。ariaDescription を用いて値を更新することができます。

html
<button
  aria-label="Close"
  aria-description="A longer description of the function of this element"
  id="close-button">
  X
</button>
js
let el = document.getElementById("close-button");
console.log(el.ariaDescription); // "A longer description of the function of this element"
el.ariaDescription = "A different description";
console.log(el.ariaDescription); // "A different description"

仕様書

仕様書
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariadescription

ブラウザーの互換性