JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div id="1">1</div>
<div id="2">2</div>
<div id="3">3</div>
<div id="4">4</div>
</div>
JavaScript
$(function() {
$("#parent").html($("#parent").children().sort(function() { return 0.5 - Math.random() }));
});