HTML & CSS · Junior · Question 11 of 75
Why link a <label> to an <input> with for and id?
- ✓Correct answer: Clicking the label focuses the field, and screen readers announce the label with it
- 2Without this link, the browser won't include the field's data on submit
- 3It is needed only for built-in validation with the
requiredattribute
Explanation
A linked label enlarges the clickable area (especially important for checkboxes) and gives the field an accessible name for assistive technologies. It doesn't affect submission or validation. The alternative is to wrap the input inside the label.