Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Sets or retrieves whether the given check box or radio button is selected.
Syntax
HTML <ELEMENT CHECKED ... > Scripting input.checked [ = bChecked ]
Possible Values
The property is read/write with a default value of false.
false The control is not selected. true The control is selected.
Remarks
Check boxes that are not selected do not return their values when the form is submitted.
Example
The following example demonstrates retrieving 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
See Also
defaultChecked
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.