Example 1 — Get and Set ariaExpanded (MDN)
Read the string, then expand the combobox control.
const el = document.getElementById("animal");
console.log(el.ariaExpanded); // "false"
el.ariaExpanded = "true";
console.log(el.ariaExpanded); // "true" How It Works
- Select the control. MDN uses a combobox input with
aria-expanded. - Read
ariaExpanded. Starts as the string"false". - Assign
"true". Reflects back toaria-expanded. - Use strings only. Do not assign boolean
true/false.

