JSFiddle - React, Tailwind, and code Playground
HTML
<div class="sample"></div>
CSS
.sample { height: 50px; width: 50px; background: red; }
.green { background: green; }
JavaScript
$(".sample").switchClass("", "green", 1000);
<div class="sample"></div>
.sample { height: 50px; width: 50px; background: red; }
.green { background: green; }
$(".sample").switchClass("", "green", 1000);