Skip to main content Accessibility Feedback

Implicit labels aren't

In HTML, you can associate a <label> with its field using the [for] attribute, with the ID of the corresponding field as its value.

<label for="season">What's your favorite season?</label>
<input type="text" id="season">

This associates the field with the <label> for assistive technology, and also lets you click the label to focus on the field. Try it yourself below.

If a <label> is wrapped around a field, it’s supposed to be associated with that field implicitly, without the need for a [for] attribute.

In reality, they’re often not.

<label>
	<input type="checkbox" name="awesome">
	I love Pixar movies
</label>

As James Edwards documents and Adrian Roselli reiterates, some voice command software will not navigate to implicitly labelled fields.

You can still wrap your fields in a <label>. That’s not a problem.

But even if you do, include a [for] attribute and matching valid ID.

<label for="pixar">
	<input type="checkbox" id="pixar" name="awesome">
	I love Pixar movies
</label>

This ensures that everyone can use your fields easily and effectively.