<div id="saveChanges" tabindex="0" role="button" aria-pressed="false">Save</div>Element: ariaPressed property / notebook
Element: ariaPressed 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("saveChanges");
console.log(el.ariaPressed); // "false"
el.ariaPressed = "true";
console.log(el.ariaPressed); // "true"