Sets or retrieves whether the given check box or radio button is selected.
Inline |
<element checked ... > |
Script |
input.checked = false | true |
false |
The control is not selected. |
true |
The control is selected. |
This attribute returns or accepts only a boolean value, meaning true if set, and false if not. The property is read/write with a default value of false.
Checkboxes and radio buttons that are not selected do not return their values when the form is submitted.
The following examples demonstrate how to retrieve the checked property and trigger an action if the property is set.
The following example demonstrates use of the CSS :checked pseudo-class to set styles for elements in a checked or selected state.
Show me
INPUT type=checkbox, INPUT type=radio