jQuery defaultchecked VS checked
I have checkbox elements on div(‘#dialog-a’) for a dialog. When an user clicks a button, then jQuery will bring the dialog with html code of div(‘#dialog-a’). Once, the user set checkbox and click “Close” button in the dialog, “Close” function supposes to set checkbox as “checked” in div(‘#dialog-a’).
$(“#elm_check”, “#hidden-area”).attr(“checked”, true);
However, the issue occurs in here. The original checkbox does not remain as “checked” state, when the dialog opens again.
$(“#elm_check”, “#hidden-area”).attr(“defaultChecked”, true);
Caution: Interestingly, ‘defaultChecked’ is case-sensitive. If you apply ‘defaultchecked’, it was not working.