<label>
The label element associates a caption with a form control to improve usability and accessibility.
Syntax
<label for="id">Caption</label> Examples
<label for="user">Username</label>
<input id="user" name="user">
<label>Remember me <input type="checkbox" name="remember"></label>
Output
Renders a labeled username field and a checkbox whose caption is also clickable.
Notes
Either point for at the control id or wrap the control inside the label. Clicking the label focuses or toggles the associated control and improves the screen-reader accessible name.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |