Javascript Reference
Categories: InputTypeRadio

javascript InputTypeRadio defaultChecked

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


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

var rBut = document.forms[0].myRadio[0];
if (rBut.checked != rBut.defaultChecked) {
    // process for changed state

Boolean value: true | false.


Determined by HTML tag attribute.

Powered by Linode.