JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">Wait for 2 seconds</div>

CSS

#test { background-color: rgba(0,0,0,0.2); height: 100px; width: 100px; font-size: 0.9em; padding: 20px; }

JavaScript

$(function () {
  setTimeout(function () {
    $('#test').animate({
      backgroundColor: 'rgba(0,255,0,0.4)'
    });
  }, 2000);
});