Example 1 — Get and Set ariaHasPopup (MDN)
Read the string, then set the preferred combobox token "listbox".
const el = document.getElementById("animal");
console.log(el.ariaHasPopup); // "true"
el.ariaHasPopup = "listbox";
console.log(el.ariaHasPopup); // "listbox" How It Works
- Select the control. MDN uses a combobox with
aria-haspopup="true". - Read
ariaHasPopup. Starts as the string"true". - Assign
"listbox". Matches a listbox popup (MDN). - Use string tokens only — not booleans.

