User Impact: Critical
Disabilities Affected:
WCAG Version:
2
WCAG Levels:
WCAG Guidelines:
Solution Techniques:
Automated Test Accuracy:
High
uTester Severity:
Error
DRRSAG Designations:
Ensure that the use of the for attribute is appropriate, otherwise remove it. Use an alternative labeling (e.g. aria-label attribute on the element) in case the label is required, but the labelled element is not a form control.
Engine scans for elements referenced by a label’s ‘for’ attribute and checks whether they are: input
, select
or textarea
HTML elements
When label elements are properly associated with input elements the label is spoken by screen readers when the field receives focus and users with impaired motor control are helped by a larger clickable area for the control, since clicking on the label or the control will activate the control.
<label for="name">First name:</label>
<input type="text" name="name" id="id_example_name" />