XHTML » input » type="checkbox"

The type="checkbox" control creates a small, square button that can be selected or unselected by the user with a click of the mouse. When the checkbox is selected, a check mark appears within the box.

A value for the name attribute is required. You must use the value attribute to assign a value that is associated with the checkbox. You can also use the checked attribute to precheck the checkbox. When the checkbox has been selected, the value is saved as part of the form information that is passed to the appropriate file and/or database when the form is submitted. However, the value for any unselected checkbox is not saved or passed.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>DevGuru XHTML input Tag Example</title>
<input type="checkbox" name="ckbx1" value="true" />
Language(s): HTML