On this page
  1. <label>
  2. Summary
  3. Notes & Best Practices
  4. Example

<label>

Prev: `<form>` | Up: forms | Next: `<input>`
Rel: forms, Forms & Inputs Guide
Ref: MDN Web Docs — <label>
Tags: #public #web #html #elements #forms #tier/core


Summary

Accessible caption bound to a form control via matching for/id.

Notes & Best Practices

Example

<label for="agree">
  <input id="agree" type="checkbox" name="agree" required />
  I accept the terms
</label>

Linked from

Related notes