JSFiddle - React, Tailwind, and code Playground

by tr_santi

HTML

<button>Reorder</button>
<div class="container">
    <img src="http://fillmurray.com/100/100" />
</div>

CSS

.container {
    padding: 20px;
    background-color: red;
}

button {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 2;
}

JavaScript

$("button").on("click", function() {
  
    var $container = $(".container");
	var $img = $container.find("img");
    $img.detach().insertAfter($container);
    var $newContainer = $container.clone();
    $newContainer.insertAfter($img);

});