Home | Top | Free Ajax Editor | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


CHECKED Attribute | checked Property

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

Syntax

HTML Scripting
< ELEMENT CHECKED ... >
object . checked [ = bChecked ]

Possible Values

bChecked Boolean that specifies or receives one of the following values.
false Default. Control is not selected.
true Control is selected.

The property is read/write. The property has a default value of false .

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.

<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>

Standards Information

This property is defined in HTML 3.2 and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .

Applies To

[ Object Name ] Platform Version
Win16:
Win32:
Windows CE:
Unix:
Mac:
 
INPUT type=checkbox , INPUT type=radio
Home | Top | Free Ajax Editor | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.