<input type="checkbox" /> Description:
The <input type="checkbox" /> tag adds checkboxes to forms.
<input type="checkbox" /> Web Browser Support:
- Netscape 2, 3, 4, 6, 7
- Mozilla 1
- Firefox 1
- Internet Explorer 2, 3, 4, 5, 6
- Opera 3, 4, 5, 6, 7, 8
- Safari 1
- WebTV / MSNTV
- AvantGo Palm OS
- AvantGo Windows CE
- HTML 3.2, 4.0
- XHTML 1.0
XHTML Forms Module XHTML Intrinsic Events Module
<input type="checkbox" /> Attributes:
- All the attributes of the input tag, plus:
- checked (optional)
- disabled (optional)
- name (optional)
- readonly (optional)
- type="checkbox"
- usestyle (optional)
- value (optional)
- width (optional)
<input type="checkbox" /> Usage:
- single input checkbox:
<form>
<input type="checkbox" name="understand" value="yes" checked="checked" /> check this box if you understand checkboxes
</form> - multiple checkboxes with the same name
<form>
What type of pets do you have?
cat <input type="checkbox" name="pet" value="cat" />
dog <input type="checkbox" name="pet" value="dog" />
rabbit <input type="checkbox" name="pet" value="rabbit" checked="checked" />
</form>
<input type="checkbox" /> Special Notes:
- Give several checkboxes the same name (as in example 2) to send a group of values to the server. Use multiple checkboxes to allow multiple choice questions where more than one answer is allowed.
- If the value is omitted, a value of "on" is, sent to the server for checked boxes.
More <input type="checkbox" /> Information:
Return to the <input /> Element
Return to XHTML Element (HTML Tags) Library

