| id | input-requires-label | |||
|---|---|---|---|---|
| title | input-requires-label | |||
| description | Requires every <input> element to have an associated <label> for accessibility compliance. | |||
| keywords |
|
import { Badge } from '@astrojs/starlight/components';
All <input> tags must have a corresponding <label> tag.
Level:
true: enable rulefalse: disable rule
<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"/><label for="some-id"/><input id="some-id" type="password" />
<input id="some-id" type="password" /> <label for="some-id"/>
<label>Password <input type="password" /></label>This rule ensures that the input element has a corresponding label element for accessibility compliance.
Further reading: Axe Rules - input elements must have labels