<button
aria-label="Close"
aria-description="A longer description of the function of this element"
id="close-button">
X
</button>Element: ariaDescription property / notebook
Element: ariaDescription property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
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"