Skip to content

input-requires-label

All <input> tags must have a corresponding <label> tag.

Level: Warning

  1. true: enable rule
  2. false: disable rule

The following patterns are not considered rule violations

Section titled “The following patterns are not considered rule violations”
<input type="password">
<input id="some-id" type="password" /> <label for="some-other-id"/>
<input id="some-id" type="password" /> <label for=""/>
<input type="password" /> <label for="something"/>

The following patterns are considered rule violations

Section titled “The following patterns are considered rule violations”
<label for="some-id"/><input id="some-id" type="password" />
<input id="some-id" type="password" /> <label for="some-id"/>