<div id="myDiv">
<input type="checkbox" id="chkAgreement" value="Y" />
</div>
When do a $("#myDiv").html()
or inspect the chkAgreement
element in the browser, the markup doesn't get updated. I was expecting a checked
attribute.
I need to grab the HTML and save it in the database. But I was surprised that the checkbox is not checked, even when it is - $("#chkAgreement").is(":checked")
returns true.
What can I do to update the DOM with the proper checked attribute for the checkbox?
Should I be doing a $("#chkAgreement").attr("checked", "checked")
, upon the user checking the box? It works, but is this the right approach or am I missing something?