<div id="reverse">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
<div id="reverse">
<div>1</div>
<div>4</div>
<div>3</div>
<div>2</div>
</div>
Array.from(document.querySelectorAll('#reverse > div'))
.slice(1)
.sort((a, b) => parseInt(b.textContent) - parseInt(a.textContent))
.forEach(el => el.parentElement.appendChild(el));