Element: ariaRoleDescription 属性
Element 接口的 ariaRoleDescription 属性反映了 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"
规范
| 规范 |
|---|
| 无障碍富互联网应用程序 (WAI-ARIA) # dom-ariamixin-ariaorientation |
浏览器兼容性
加载中…