Working with check boxes

To create check boxes, use the following HTML tag:

<input type="checkbox" name="name" value="value" />

where name identifies the field containing the check box and value attribute specifies the value sent to the CGI script.

To make a particular check box a default option, use the attribute checked="checked":

<input type="checkbox" name="name" value="value" checked="checked" />

The check boxes are used when the input options are not mutually excluding.

LayoutHTML tags
What colors do you like?
black
blue
green
yellow
red
white
<form>
What colors do you like? <br>
<input type="checkbox" name="black" checked="checked" /> black <br />
<input type="checkbox" name="blue" /> blue <br />
<input type="checkbox" name="green" checked="checked" /> green <br />
<input type="checkbox" name="yellow" /> yellow <br />
<input type="checkbox" name="red" /> red <br />
<input type="checkbox" name="white" /> white
</form>

Try how it works: