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 |
浏览器兼容性
加载中…