The reason the checkboxes are being reset is the way the innerHTML() is adding content. Instead of just appending the new content, you’re grabbing the existing content, then overwriting it with a copy, plus the new content. Basically.
This means the HTMl is preserved perfectly, but NOT the state of the elements, for instanced, the checked property.
With this, you should be golden. Let me know how it goes!