JSFiddle - React, Tailwind, and code Playground

HTML

<div id="someDiv"></div>

CSS

#someDiv {
  width: 10px;
  height: 10px;
  border: 1px solid black;
}

JavaScript

$("div#someDiv")
  .queue(function() {
    console.log('step 1');
    $(this).css({
      'background-color': 'blue'
    }).dequeue();
  })
  .delay(800)
  .queue(function() {
    console.log('step 1');
    $(this).css({
      'background-color': 'red'
    }).dequeue();
  })