DOM HTMLInputElement.checked Property
The checked property gets or sets whether a checkbox or radio button is ticked.
Description
The checked property reflects the current checked state of a checkbox or radio button. Setting it updates the control immediately, without firing a change event. The checked attribute only sets the initial state. For checkboxes, the separate indeterminate property shows a "mixed" state.
Only one radio button in a group (those sharing a name) can be checked, so checking one with script unchecks the others. To read which radio is selected, use form.elements.groupName.value, or querySelector('input[name=size]:checked').
The defaultChecked property reflects the checked attribute and is what form.reset() returns the control to. The change event fires when the user changes it, but not when you set it from script.
Syntax
input.checked
input.checked = true | falseValue
true if the checkbox or radio button is checked, otherwise false.
Example
Browser Support
The following information will show you the current browser support for the HTMLInputElement.checked property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





