HTML & CSS · Junior · Question 11 of 75

Why link a <label> to an <input> with for and id?

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.

Further reading

Problem with a question

HTML & CSS · Junior · question 11

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz