HTML Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
HTML Basic
Introduction
How To
HTML Tags
html, head, body
Text Manipulation
IMAGES
Special Effects
Using Tables
Forms
Other Topics
 

ADVANCED HTML
Introduction
Media
Meta Tag
Frame tags
Fieldset
Tooltip
DTD
Image tags
Subscript & Superscript
Bullet styles
Canvas
Other tags
Ask Your Doubts
More about HTML
Feedback
 

HTML Check Box Tag


Tutorials Html

Topic

How to create a checkbox in html?
How to make check box pre selected?
How to disable check box?



Explanation

Check Box

Example Code:
<form name=myform>
<input type="checkbox" name=mybox value="1">one
<input type="checkbox" name=mybox value="2">two
<input type="checkbox" name=mybox value="3">three
</form>


Result:
one two three

Definition:
Here we define the check box using "input" tag. We give a attribute called "TYPE=checkbox" in the tag which defines the type as a checkbox.
The attribute "name" should be defined and be same.
The value in this case will be used only during form processing.

Pre selected Checkbox
We can make a check box pre selected (checked) even before the users try to select, using the entry "checked"

Example Code:
<form name=myform>
<input type="checkbox" name=mybox value="1" checked>one
<input type="checkbox" name=mybox value="2" >two
<input type="checkbox" name=mybox value="3" checked>three
</form>


Result:
one two three

Non Editable / Non Selectable check box
We can make a Checkbox non selectable (disable) using the entry "disabled"

Example:
<form name=myform>
<input type="checkbox" name=mybox value="1" disabled>one
<input type="checkbox" name=mybox value="2" disabled>two
<input type="checkbox" name=mybox value="3" disabled>three
</form>


Result:
one two three




Other Links

web hosting