HTML: input type="checkbox"

A checkbox represents an independent choice that can be checked or left unchecked, such as agreeing to terms or selecting several interests.

What you will learn

Minimal example

<label>
  <input type="checkbox" name="topics" value="css">
  CSS
</label>

When checked, the browser submits the field's name and value. An unchecked checkbox is normally omitted from the submitted form data.

Common mistakes