<button aria-expanded="false" aria-controls="widget1">Toggle widget</button>ARIA: aria-expanded attribute / notebook
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.
<button aria-expanded="true" aria-controls="widget1">Toggle widget</button><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>