JSFiddle - React, Tailwind, and code Playground

HTML

<div id="hello">the sample</div>

JavaScript

$("#hello").queue("xxx",function(){
    $("#hello").append("<br />queued");
    setTimeout(function(){
          $("#hello").append("<br />timeout end");        
        $("#hello").dequeue("xxx");
        
    },1500);
});
$("#hello").queue("xxx",function(){
    $("#hello").append("<br />queued2");
});
                
$("#hello").append("<br />before dequeue");
$("#hello").dequeue("xxx");
$("#hello").append("<br />after dequeue");