accessaudit

How to fix drop-down lists without a label

WCAG 4.1.2 Name, Role, Value, level A. Rule select-name in axe-core.

What is wrong

A <select> element has no label. A screen reader announces something like "combo box, M", without saying that this is the size. On shop sites the usual cases are size and colour pickers, the "sort by" list, and the country list at checkout.

Who it blocks

Screen reader users and voice control users.

How to fix it

<label for="size">Size</label>
<select id="size" name="size">
  <option>S</option>
  <option>M</option>
</select>

If there is no room for visible text, <select name="sort" aria-label="Sort products by"> is the smallest change.

Common mistakes

How the scan proposes a fix

The scan adds an aria-label built from the list's name or id, runs the same rule on the fixed markup, and checks that no existing attribute changed.

Check your own pages for free

Drag this button onto your bookmarks bar: Scan with accessaudit. Then open a page of your shop and click the bookmark: a score and the three main defects appear in a few seconds. The check runs in your browser: no content of your page leaves it, only the scanner is downloaded from this site. Try it on a demo shop.