Horje
How to create HTML Checkboxes

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

Checkboxes let a user select ZERO or MORE options of a limited number of choices.


Example of HTML Checkboxes

A form with checkboxes:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Checkboxes</h2>
<p>The <strong>input type="checkbox"</strong> defines a checkbox:</p>

<form action="/action_page.php">
  <input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
  <label for="vehicle1"> I have a bike</label><br>
  <input type="checkbox" id="vehicle2" name="vehicle2" value="Car">
  <label for="vehicle2"> I have a car</label><br>
  <input type="checkbox" id="vehicle3" name="vehicle3" value="Boat">
  <label for="vehicle3"> I have a boat</label><br><br>
  <input type="submit" value="Submit">
</form> 

</body>
</html>

Output should be:

Example of HTML Checkboxes
Reffered: https://www.w3schools.com/html/html_forms.asp





Related Articles
What is HTML Forms HTML Forms
What is The <form> Element HTML Forms
What is The <input> Element HTML Forms
What is Text Fields HTML Forms
What is The HTML <label> Element HTML Forms
How to add HTML Radio Buttons HTML Forms
How to create HTML Checkboxes HTML Forms
How to create HTML Submit Button HTML Forms
How to create HTML Name Attribute for <input> HTML Forms
What is HTML Form Attributes HTML Forms

Single Articles
Example of HTML CheckboxesHTML Forms

Read Full:
HTML Forms
Category:
Web Tutorial
Sub Category:
HTML Forms
Uploaded:
11 months ago
Uploaded by:
Admin
Views:
24



Share on: