Give every form field a label that screen readers announce
Form elements must have labels is the message for axe's label rule, and it means an input or textarea has no accessible name, so a screen reader can announce the field but not what to type in it. The fix is a label element connected to the field, either with a for attribute that matches the field's id or by wrapping the field inside the label. Placeholder and title text pass the rule, but they make weak labels.
Ways to label a field, from best to last resort
| Markup | When to use it |
|---|---|
A <label for="email"> holding the word Email, then <input id="email" type="email"> | The default. W3C's labels tutorial says explicit labels are better supported by assistive technology, and browsers turn the label into a larger click target for its field. |
<label>Email <input type="email"></label> | Wrapping the field in its label connects them without an id. It suits a label that sits right beside its field. |
| A label hidden with a visually hidden class | For a design that shows no label where the purpose is clear from what's around the field. Use a visually hidden class, never display: none, which hides the label from screen readers too. |
aria-labelledby naming the id of visible text | For a field whose label words appear elsewhere on the page, such as in a table header, or a field that needs two pieces of text as its label. |
<input type="search" aria-label="Search"> | For a field that another visual cue already labels, such as a search box beside a magnifying-glass button, which is the example Deque's label rule gives. |
A title or placeholder attribute alone | axe accepts either one as a name. W3C calls the title approach less reliable, and Deque advises against placeholder labels because the text disappears once someone starts typing. |
Why axe still flags a field that looks labeled
Text beside the field but not tied to it
Words like First name placed next to an input look like a label, but with no label element or ARIA reference connecting them, assistive technology can't pair the two.
A for value that matches no id
The label's for attribute has to match the field's id exactly. A typo, or an id a component generates differently on each render, leaves the label pointing at nothing.
A label hidden from screen readers
axe fails a field whose connected label is hidden with display: none or the hidden attribute when nothing else names it. Text hidden only visually still counts.
An empty or broken ARIA label
An empty aria-label gives no name. An aria-labelledby fails when the id it names doesn't exist or belongs to an element with no text.
These checks and their messages are in axe-core's message list, and W3C's labels tutorial covers the exact match between for and id.
How to fix a missing form label
- Find each field axe listedEach result points at one input or textarea. Note whether it's always on the page, appears after a script runs, or comes from a plugin whose settings you'll change rather than its markup.
- Write the label textUse the words a sighted visitor relies on, such as Email address or Order number. If the design shows no words at all, consider whether a visible label would help everyone before you hide one.
- Connect the label in the markupAdd a label whose for attribute matches the field's id, or wrap the field in the label. Reach for aria-label only when something on screen already makes the field's purpose clear.
- Click each label elementA label element tied to its field puts the cursor in the text field, or ticks the checkbox, when you click it. If nothing happens, the for and id don't match. Fields named with aria-label or aria-labelledby don't react to clicks, so check those with the rule.
- Run the rule againRerun axe on the page, including any form step that only appears after an earlier one is filled in.
Frequently asked questions
Is placeholder text enough to label a form field?
It passes axe, but it makes a poor label. Deque's label rule explains that a placeholder disappears once someone types, so they can lose track of what the field asked for. Put the purpose in a label and keep the placeholder, if you want one, for an example of the format.
Do radio buttons need a fieldset to pass?
Not for this rule, which needs each radio button and checkbox to have its own label. The question that groups them belongs in a fieldset with a legend, which W3C's grouping tutorial says radio button groups should always use. Keep the legend short, since some screen readers read it with every option.
Why doesn't axe list my select menu here?
Select menus have a rule of their own, select-name, whose message is Select element must have an accessible name. Deque's select-name page gives the same fixes, starting with a label element tied to the select by its id.
How common are missing form labels?
Very. WebAIM's 2026 Million report found missing form input labels on 51% of the top million home pages, and a third of all the form inputs it found weren't properly labeled.
Fix the other names screen readers announce
- Website accessibilityFind what stops people with disabilities from using your site.
- Fix the accessibility problems Lighthouse reportsFix the form label, link name, lang, heading order and ARIA warnings in Lighthouse.
- Empty buttonsGive icon-only buttons a name that says what they do.
- WCAG 2.2 AA checklistPlan the A and AA criteria review and identify the decisions that need a person.