Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 584 Bytes

form-has-label.md

File metadata and controls

24 lines (18 loc) · 584 Bytes

form-has-label

Each form element must have a programmatically associated label element. You can do so by using an implicit , explicit , aria-label or aria-labelledby.

References

  1. https://dequeuniversity.com/rules/axe/2.1/label

Rule details

Succeed

<label><input type="text" /></label>
<input aria-label="test"  type="text" />
<input aria-labelledby="#id"  type="text" />
<label for="id"></label><input aria-labelledby="#id" id="id"/>
<input type="image" />

Fail

<input value="1" type="text" />
<textarea value="ad"></textarea>