JSFiddle - React, Tailwind, and code Playground

by charlescarver

HTML

<div class="parent">
    <div class="second">
        <div class="third">
            <ul>
                <li>Hey</li>
            </ul>
            <ul>
                <li>Hey 2</li>
            </ul>
            <ul>
                <li>Hey3</li>
            </ul>
        </div>
    </div>
</div>
<div class="parent">
    <div class="second">
        <div class="third">
            <ul>
                <li>Howdy</li>
            </ul>
        </div>
    </div>
</div>

CSS

.parent {
    background-color:red;
    padding:20px;
}
.second {
    background-color:blue;
    padding:20px;
}
.third {
    background-color:green;
    padding:20px;
}
ul {
    background-color:orange;
    padding:20px;
}
li {
    background-color:pink;
    padding:20px;
}

JavaScript

var nodes = [];

$('body').children().each(function() {
    [].push.apply(nodes, $('*', this).get().reverse());
    nodes.push(this);
});

var i = 0;

function loop() 
{
	$(nodes[i]).remove();
	if (++i < nodes.length) {
		setTimeout(loop, 1000);
	}
}

loop();