Learning Resources
 

Check Box Control


Checkboxes are used when more than one option is required to be selected. They are created using tag as shown below.

Here is example HTML code for a form with two checkboxes

Maths Physics

The result of this code is the following form

Maths Physics

Following is the list of important checkbox attributes:

  • type: Indicates that you want to create a checkbox.

  • name: Name of the control.

  • value: The value that will be used if the checkbox is selected. More than one checkbox should share the same name only if you want to allow users to select several items from the same list.

  • checked: Indicates that when the page loads, the checkbox should be selected.