MDN self-hosted library · e01.org

ARIA: aria-expanded attribute

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

html
<button aria-expanded="false" aria-controls="widget1">Toggle widget</button>
html
<button aria-expanded="true" aria-controls="widget1">Toggle widget</button>
html
<label for="username">Username</label>
<input id="username" name="username" aria-describedby="username-desc" />
<button
  aria-expanded="false"
  aria-controls="username-desc"
  aria-label="Help about username"
  type="button">
  <span aria-hidden="true">?</span>
</button>
<p id="username-desc" hidden>
  Your username is the name that you use to log into this service.
</p>