Element: ariaRoleDescription プロパティ
Baseline
広く利用可能
この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2023年10月以降、すべてのブラウザーで利用可能です。
ariaRoleDescription は Element インターフェイスのプロパティで、要素のロールに関する人間が読み取り可能な、作者がローカライズした説明を定義する aria-roledescription 属性の値を反映します。
値
文字列です。
例
この例では、ID が myApplication である要素の aria-roledescription 属性が設定されています。ariaRoleDescription を用いて値を更新することができます。
html
<div
id="myApplication"
role="application"
aria-roledescription="a description of this widget">
…
</div>
js
let el = document.getElementById("myApplication");
console.log(el.ariaRoleDescription); // "a description of this widget"
el.ariaRoleDescription = "an updated description of this widget";
console.log(el.ariaRoleDescription); // "an updated description of this widget"
仕様書
| 仕様書 |
|---|
| Accessible Rich Internet Applications (WAI-ARIA)> # dom-ariamixin-ariaorientation> |