JSFiddle - React, Tailwind, and code Playground

HTML

<div id="div1"></div>

CSS

#div1{
    height:100px;
    width:100px;
    background-color:Black;
}

JavaScript

$("#div1").click(function() {
    $(this).fadeOut(1000, function() {
        $(this).css("background-color", "#FF0000").fadeIn(1000);
    });
});