JSFiddle - React, Tailwind, and code Playground

by NibblyPig

HTML

<div class="box">

</div>

CSS

.box {
  background-color: red;
  width: 50px;
  height: 50px;
}

JavaScript

$('.box').on('click', function () {

	var initialColour = $(this).css("background-color");

	$(this).css("background-color", "green").animate({ "background-color": initialColour }, 600);

});