Checkbox Object

By: aathishankaran Viewed: 1379 times  Printer Friendly Format    

The checkbox object is the form object that is best equipped to denote logical (true or false) data. It acts as a toggle switch that can be turned on or off either by the user or by your JavaScript code. To define a checkbox, use the following HTML syntax:

<INPUT TYPE="checkbox"[NAME="objectName"] [VALUE="value"] [CHECKED][onClick="methodName"]> [displayText] 

For example, the following checkbox allows users to specify their foreign language proficiencies: 

<input type=checkbox name="language"> I speak multiple languages.





Check box Example



<Hl>Example for CheckBox</Hl>

<H2>Click on the checkBox and find the status</H2>


<Form Name=form1>



<Input Type=CheckBox



if (svr. checked)


alert('The status is true');




alert('The status is false');









If you check the checkbox

If you uncheck the checkbox


Most Viewed Articles (in JSP )

Latest Articles (in JSP)

Comment on this tutorial