Checkboxes and Radio Buttons
Learn when to use checkboxes (pick many) vs radio buttons (pick one), how grouping works, and why labels are even more critical for these small targets.
Checkboxes — pick as many as you want
A checkbox lets the user toggle an option on or off. Unlike a text input where the user types something, a checkbox is a simple yes/no choice. When the form is submitted, only checked boxes send their data — unchecked boxes send nothing.
You create a checkbox with <input type="checkbox">. Each checkbox needs:
name— the key sent to the servervalue— the value sent when the box is checked (if omitted, the browser sends "on")
The checked attribute makes a checkbox pre-selected when the page loads:
<input type="checkbox" name="newsletter" value="yes" checked>
Checkboxes are independent — checking one has no effect on others. This is the key difference from radio buttons. Use checkboxes when the user can select zero, one, or many options from a list.
Real-world examples everywhere: Amazon's filter sidebar ("Free Shipping", "Prime", "4 Stars & Up" — you can check multiple), Gmail's message selection (check multiple emails to delete or archive), and Instagram's interest selection during signup (pick all topics that interest you).