Skip to main content
checked attribute | checked property

Sets or retrieves the state of the check box or radio button.

HTML 4.01 Specification, Section 17.4



HTML<element checked="p" ... >

p = object.checked


Property values

Type: Boolean


Default. Control is not selected.


Control is selected.

Standards information


Check boxes that are not selected do not return their values when the form is submitted.

A user can select a radio button only if the button has a name. To clear a selected radio button, a user must select another button in the set.

Windows Internet Explorer 8 and later. In IE8 Standards mode, parsing operations on the checked content attribute always affect both the checked content attribute and defaultChecked Document Object Model (DOM) attribute. For example, removeAttribute('checked') sets both checked and defaultChecked to false. Similarly, setAttribute('checked', 'checked') sets both DOM attributes to true (as if the element was being re-parsed) For more information on IE8 mode, see Defining Document Compatibility.

Internet Explorer 8 and later. In IE8 mode, the defaultChecked DOM attribute reflects the value of the checked content attribute.


This example retrieves the checked property to fire an event.

Code example:

    <script type="text/javascript">
    function checkthis()
        if (oCheckbox.checked == true)
    <p>Check here if you wish to go to Microsoft:
    <input id="oCheckbox" type="checkbox" onclick="checkthis()"></p>

See also

input type=checkbox
input type=radio
Introduction to Forms
Form controls part 1
Form controls part 2: validation