← CodePrimer
HTML Beginner Forms

Explicit label for= binding

How do I connect a label to an input?

for and id pairing.

Sample
<label for="email">Email</label>
<input id="email" name="email" type="email" required>

Notes

Clicking the label focuses the control — better UX and a11y.

Keywords: label · for · id · a11y · form

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share