**`<label>`** connects to a form control in one of two ways: explicitly, matching its **`for`** attribute to the control's **`id`** (as shown above), or implicitly, by wrapping the control directly inside the `<label>` (`<label>Email <input type="email"></label>`). Either way, clicking anywhere on the label text focuses (or, for a checkbox/radio, toggles) the associated control — and screen readers announce the label text whenever the user focuses that control, which is essential for understanding what a field is for.
1Understanding <label>
`<label>` connects to a form control in one of two ways: explicitly, matching its `for` attribute to the control's `id` (as shown above), or implicitly, by wrapping the control directly inside the <label> (<label>Email <input type="email"></label>). Either way, clicking anywhere on the label text focuses (or, for a checkbox/radio, toggles) the associated control — and screen readers announce the label text whenever the user focuses that control, which is essential for understanding what a field is for.
A placeholder is NOT a substitute for a <label> — it disappears the moment the user starts typing, and many screen readers don't announce it as reliably as a real, persistent label.
<label for="username">Username</label>
<input type="text" id="username" name="username">2Practical Example
Here is a real-world application of <label> showing how it is used in production HTML.
<!-- Implicit label: wrapping the control instead of using for/id -->
<label>
<input type="checkbox" name="subscribe">
Subscribe to newsletter
</label>3Best Practices
Follow these guidelines when working with <label>:
1. Give every form control a proper <label>, using either for/id or wrapping
2. Make label text click-expand the clickable area for checkboxes/radios — a real usability win, especially on mobile
3. Never rely on placeholder text alone as the only labeling for a field
Tip: A placeholder is NOT a substitute for a <label> — it disappears the moment the user starts typing, and many screen readers don't announce it as reliably as a real, persistent label.
<label for="username">Username</label>
<input type="text" id="username" name="username">