all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

defaultChecked property

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

Syntax

JavaScript

p = object.defaultChecked

 

Property values

Type: Boolean

true (true)

Default. Check box or radio button is selected by default.

false (false)

Check box or radio button is not selected by default.

Standards information

Remarks

The property can be changed programmatically, but doing so has no effect on the appearance of the check box or radio button or on how forms are submitted.

Windows Internet Explorer 8 and later. In IE8 Standards mode, the defaultChecked Document Object Model (DOM) attribute reflects the value of the checked content attribute. For more information, see Attribute Differences in Internet Explorer 8.

Internet Explorer 8 and later. In IE8 mode, parsing operations on the checked content attribute always affect both the checked content attribute and defaultChecked 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).

See also

input type=checkbox
input type=radio
checked

 

 

Show:
© 2014 Microsoft