JSFiddle - React, Tailwind, and code Playground

by Zsanett Tamás

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
<p>Click <em>here</em> and text color will change after 3 seconds.</p>
<p>Click <em>here</em> and text color will change after 3 seconds.</p>
<p>Click <em>here</em> and text color will change after 3 seconds.</p>

CSS

p { font-size: 24px; color: green }
em { background-color: yellow; cursor: pointer }

.change {
    animation: change 3s step-end both;
}

@keyframes change {
    to   { color: red }
}

JavaScript

$(document.body).on('click', 'em', function () {
    $(this).parent().addClass('change');
});