JSFiddle - React, Tailwind, and code Playground

HTML

<div class="details1" id="clrd" style="height:100px; width:100px; border:1px solid black;"></div>

CSS

div.on {
    background: #F78181;
}

JavaScript

$('.details1').click(function(){
        setTimeout(function(){ $('#clrd').toggleClass('on'); }, 200);
    });