JSFiddle - React, Tailwind, and code Playground

by id0

HTML

<div class="buttons js-buttons">
  <button class="button js-button" type="button">1</button>
  <button class="button js-button" type="button">2</button>
  <button class="button js-button" type="button">3</button>
</div>

SCSS

.buttons {
  display: flex;
  flex-direction: column;
  width: 50px;
  margin: 20px auto;
 }
 .button {
   order: 0;
   margin: 5px;
   padding: 8px 10px;
   cursor: pointer;
 }

JavaScript

$('.js-button').on('click', function() {
  $(".js-button:first").detach().insertAfter(".js-button:last");
});