Sets or retrieves the state of the check box or radio button.
Syntax
HTML <ELEMENT CHECKED = bChecked ... > Scripting input.checked [ = bChecked ]
Possible Values
bChecked Boolean that specifies one of the following values:
false Control is not selected. true Control is selected. The property is read/write with a default value of false.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.
Remarks
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.
Example
This example retrieves the checked property to fire an event.
Sample Code
<HEAD> <SCRIPT> function checkthis() { if (oCheckbox.checked == true) { alert("It's got a check; now off to Microsoft!"); window.open("http://www.microsoft.com"); } } </SCRIPT> </HEAD> <BODY> Check here if you wish to go to Microsoft: <INPUT ID=oCheckbox TYPE=checkbox onclick=checkthis()> </BODY>
Applies To
INPUT TYPE=checkbox, INPUT TYPE=radio
See Also
defaultChecked, Forms Overview