JSFiddle - React, Tailwind, and code Playground

by efedorenko

HTML

<div class="box-to-illuminate"></div>

CSS

.box-to-illuminate {
    width: 200px;
    height: 200px;
    margin: 20px;
    background-color: yellow;
    -webkit-transition: background 500ms ease;
    -moz-transition: background 500ms ease;
    transition: background 500ms ease;
}
.box-to-illuminate.illuminate {
    background-color: red;
}

JavaScript

$('.box-to-illuminate').click(function () {
    var self = $(this),
        timeout;

    self.addClass('illuminate');

    timeout = window.setTimeout(function () {
        self.removeClass('illuminate');
    }, 500);
});