You can even use native JS for this. In this case, add the new HTML to the hidden div using its innerHTML property as follows:
document.getElementById('hidden_div_id').innerHTML = myHTML;
After adding new HTML, you can go through the nodes using whatever methods you want.
source share