I have a form that is similar to this:
<fieldset id="user">
<input type="text" id="firstName">
<input type="text" id="lastName">
</fieldset>
Then I do an Ajax call to fill the values of those two fields. At this point I want to save the current state of the form (with the populated values) in case the user needs to revert back after making a change.
I've tried this:
$("#user").clone(true).html()
As well as this:
$("#user").html()
both return the original html from the dom that was created before the fields were populated. Is there a way to grab the html with the values after they have been populated with JS?