Element: ariaDescription 屬性
Element 介面的 ariaDescription 屬性反映了 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"
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariadescription |
瀏覽器相容性
載入中…