THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML <input type="checkbox">

❮ HTML <input> type attribute

Example

Let the user select one or more options of a limited number of choices:

<input type="checkbox" name="vehicle1" value="Bike"> I have a bike<br>
<input type="checkbox" name="vehicle2" value="Car"> I have a car<br>
<input type="checkbox" name="vehicle3" value="Boat" checked> I have a boat<br>
Try it Yourself »

Definition and Usage

The <input type="checkbox"> defines a checkbox.

The checkbox is shown as a square box that is ticked (checked) when activated.

Checkboxes are used to let a user select one or more options of a limited number of choices.


Browser Support

Attribute
type="checkbox" Yes Yes Yes Yes Yes

Syntax

<input type="checkbox">

❮ HTML <input> type attribute