HTML Online Tools Useful Online Tools for Webmasters

HTML Checkbox

A checkbox has two status : checked or non checked. It is defined using the input tag associated with the type attribute with the value "checkbox". A checkbox has no label, it contains only a visible box.

When the checkbox is unselected, the server will receive no value. Otherwise it will receive the checkbox value.

Usual attributes

Attribute name Attribute value
class Set a value for CSS rules. The CSS rule will be applied to all tags with the same class name
checked This attribute (no value is required) will initialize the component with a checked state.
disabled It will disable for any usage the component
id Set a unique value, it is useful for JavaScript or for CSS rule. For CSS it will be applied only for this tag
name The name of the parameter sent to the server
style Set a CSS value. It has always priority for general CSS rules. Sample : "background-color:red;color:white"
value The value sent to the server when the component is checked

Example

Preview


-- Try our Visual HTML Editor --