MDN self-hosted library · e01.org

Element: ariaRoleDescription property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

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"