JSFiddle - React, Tailwind, and code Playground
HTML
<div id="holder">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<div id="click"> Go </div>
CSS
#holder {
background:#ddd;
display:inlne-block;
width:390px;
}
#click {
padding:10px;
cursor:pointer;
background:green;
width:30px;
text-align:center;
}
#holder div {
text-align:center;
background:orange;
display: inline-block !important;
vertical-align:top;
width:100px;
height:100px;
color:red;
border:5px solid #777;
line-height:100px;
margin:10px 0 10px 10px;
font-size:30px;
}
JavaScript
var count = 4;
function fdrv() {
$('#holder div').last().remove();
$('#holder').prepend('<div>'+count+'</div>');
count++;
}
$('#click').click(function() {
fdrv();
});