Javascript Reference
Categories: InputTypeCheckbox

javascript InputTypeCheckbox defaultChecked

@March 15, 2008, 1:22 a.m.
defaultCheckedFirefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM 1  

Read/Write  

Specifies whether the element has the checked attribute set in the tag. You can compare the current checked property against defaultChecked to see whether the state of the control has changed since the document loaded. Changing this property does not affect the current checked status.

 
Example
 
var cBox = document.forms[0].checkbox1
if (cBox.checked != cBox.defaultChecked) {
    // process for changed state
}
 
Value

Boolean value: true | false.

 
Default

Determined by HTML tag attribute.


Powered by Linode.