1. Home
  2. Computing & Technology
  3. Web Design / HTML

<input type="checkbox" />

By , About.com Guide

<input type="checkbox" /> Description:

The <input type="checkbox" /> tag adds checkboxes to forms.

<input type="checkbox" /> Web Browser Support:

<input type="checkbox" /> Attributes:

<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

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. The input type="checkbox" Element - check box forms - XHTML 1.0 HTML 4.0

©2009 About.com, a part of The New York Times Company.

All rights reserved.