Checkbox in Html
This is used for selecting multiple items in group.
The input checkbox object represents an HTML input element with type="checkbox".
If you use the checkbox without label tag, you can select it by exactly clicking on the square.
If you use it with a label tag you can select it by clicking on the label.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Checkbox</title>
</head>
<body>
<!--You should click the checkbox, if you click on the 'Car'---->
Simple Checkbox</br>
<input type="checkbox" name="vehicle">Car
<input type="checkbox" name="vehicle">Bullet
<input type="checkbox" name="vehicle">Scooty
<!--You can click on the label also---->
</br>
Checkbox with label</br>
<label>
<input type="checkbox" name="vehicles">Car
</label>
<label>
<input type="checkbox" name="vehicles">Bullet
</label>
<label>
<input type="checkbox" name="vehicles">Scooty
</label>
</body>
</html>
Output of this code will look like this:
