Syntax
document.form.checkbox.defaultChecked
The defaultChecked property holds the initial state of a check box as defined by the checked attribute of the tag.
It is a read-only Boolean value.
<html>
<form name="orderForm">
<input type="checkbox" name="door4">4 doors<br>
<input type="checkbox" name="door2" checked>2 doors<hr>
Step 2:
<input type="button" value="Submit Order" name="orderButton" onClick="alert('submitted')">
<input type="button" value="Reset Checkboxes" name="resetButton" onClick="resetCheckboxes()">
</form>
<script language="JavaScript">
<!--
function resetCheckboxes()
{
document.orderForm.door4.checked = document.orderForm.door4.defaultChecked;
document.orderForm.door2.checked = document.orderForm.door2.defaultChecked;
}
-->
</script>
</html>