HTML DOM defaultChecked Property
Complete Radio Object Reference
Definition and Usage
The defaultChecked property returns the default value of the checked attribute.
This property returns true if the radio button is checked by default,
otherwise it returns false.
Syntax
radioObject.defaultChecked
|
Example
The following example returns the default value of the checked attribute:
<html>
<body>
<form>
<input type="radio" id="radio1" checked="checked" />
</form>
<script type="text/javascript">
alert(document.getElementById("radio1").defaultChecked);
</script>
</body>
</html>
|
Try-It-Yourself Demos
Return the default state of a radio button's checked attribute
Complete Radio Object Reference
|