Website Spec
← Accessibility
Required

Form labels

Every form control needs a programmatically associated label. A placeholder is not a label, and an unlabelled input is unusable for screen-reader and voice-control users.

What it is

A label is the human-readable name of a form control. It must be associated with the control in the accessibility tree so that assistive technologies announce it, click targets are extended to the label text, and voice-control users can say the field's name to focus it.

Why it matters

An input without a label is a black box. A screen-reader user hears "edit, blank"; a voice-control user has nothing to say to reach it; a sighted user with a cognitive impairment can lose track of which field they are in when the placeholder disappears on focus. WCAG 3.3.2 (Level A) requires labels or instructions; 1.3.1 (Level A) requires that the relationship between label and field be programmatically determinable.

How to implement

Prefer a visible <label> element associated by for/id:

<label for="email">Email address</label>
<input type="email" id="email" name="email" autocomplete="email">

Wrapping the input inside the label works too:

<label>
  Email address
  <input type="email" name="email" autocomplete="email">
</label>

When the visual design genuinely cannot show a label (an icon-only search field, for example), use aria-label or aria-labelledby — but only as a last resort:

<input type="search" aria-label="Search the site">

A few hard rules:

Common mistakes

Verification

Sources