English
German

HTML Checkboxes

HTML Checkbox Forms

Checkboxes are another type of <input /> form. We set the type attribute to check and we also must set a name and value attribute for them to be at all helpful.

Checkbox Example:

<p>Please select every sport that you play.</p>
Cricket: <input type="checkbox" name="sports" value="cricket"  /><br />
NBA: <input type="checkbox" name="sports" value="NBA"  /><br />
Golf: <input type="checkbox" name="sports" value="Golf"  /><br />
Basketball: <input type="checkbox" name="sports" value="basketball"  />
 

Output

Please select every sport that you play.

Cricket:
NBA:
Golf:
Basketball:

Checkboxes are used for instances where a user may wish to select multiple options, a sort of check all that apply question.


HTML Checkboxes Selected

It is possible to precheck the input boxes for your viewers using the checked attribute. Simply set the checked attribute to yes or no.

Example:

<p>Please select every sport that you play.</p>
Soccer: <input type="checkbox" checked="yes"
 name="sports" value="soccer" />
<br />
Football: <input type="checkbox"
name="sports" value="football" />
<br />
Baseball: <input type="checkbox"
name="sports" value="baseball" />
<br />
Basketball: <input type="checkbox" checked="yes"
name="sports" value="basketball" />

Output

Please select every sport that you play.

Soccer:
Football:
Baseball:
Basketball:

HTML Tutorial,HTML Checkboxes, HTML Checkboxes example, learn HTML Checkboxes,explain example HTML Checkboxes online free training HTML Tutorial, HTML Tutorial example, learn HTML Checkboxes, online tutorial, download tutorial, HTML Tutorial books, HTML Tutorial videos, live videos HTML Tutorial, learn HTML Tutorial, HTML Tutorial topic HTML Checkboxes, live training HTML Tutorial, download free tutorial