Skip to content

Rule request: no redundant `for`

<label> can reference the labelable element either using the for-attribute or as a descendant but using both is redundant.

Examples

Invalid:

<label for="foo">
  <input id="foo">
</label>

Valid:

<label>
  <input>
</label>
<label for="foo">...</label>
<input id="foo">

Options

None