Is there a difference between these two ways of default checking a checkbox:
document.getElementById(checkboxId).defaultChecked = checked;
vs
document.getElementById(checkboxId).checked = checked;
defaultChecked
is the default state, checked
is the current state.
If you change defaultChecked
and then press a <input type="reset">
then the checkbox should reset to the state specified in the defaultChecked
property.
If you change checked
, then the state will change immediately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With