MDN self-hosted library · e01.org

Element: ariaLevel property

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

html
<div role="heading" id="main-heading" aria-level="1">
  This is a main page heading
</div>
js
let el = document.getElementById("main-heading");
console.log(el.ariaLevel); // "1"
el.ariaLevel = "2";
console.log(el.ariaLevel); // "2"