JSFiddle - React, Tailwind, and code Playground

HTML

<div class="top-to-bottom">
    <div class="child a"></div>
    <div class="child b"></div>
    <div class="child c"></div>
    <div class="child d"></div>
</div>

CSS

.top-to-bottom {
    position: absolute;
}

.child {
    width: 50px;
    height: 50px;
}

.a {
    background:blue;
    
}
.b {
    background:red;
}

.c {
    background:purple;
}

.d {
    background:green;
}

JavaScript

var parent = document.getElementsByClassName('top-to-bottom')[0],
    divs = parent.children,
    i = divs.length - 1;

for (; i--;) {
    parent.appendChild(divs[i])
}