← CodePrimer
HTML
Beginner
Forms
Explicit label for= binding
How do I connect a label to an input?
for and id pairing.
<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
HTML
HTML headings h1–h6
How do I create page headings?
HTML
Paragraphs and line breaks
How do I break text into paragraphs?
HTML
Hyperlinks with href
How do I make a clickable link?
HTML
Ordered and unordered lists
How do I make bullet or numbered lists?
HTML
HTML table structure
How do I display tabular data?
HTML
Image with alt text
How do I insert an image accessibly?