JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">
    <div id='container1'>
        <script>alert('hello world 1');</script>
        <span>hello world</span>
        <div id='container1.1'>
            <script>alert('hello world 2');</script>
            <div id='container1.1.1'>
                <table>
                    <tr>
                        <td>
                            <script>alert('hello world 3');</script>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>

JavaScript

var html = $('#test').html();
alert("Source:" + html);

// Start of the test
var html_parsed = $(html);
alert("Length:" + html_parsed.length);

html_parsed.each(function(i) {
    alert(i + '=' + $(this).html());
});