JSFiddle - React, Tailwind, and code Playground
HTML
<button id="pulsate">I want to pulsate!</button>
JavaScript
$('#pulsate').on('click', function () {
pulsate(this); // Change here
});
function pulsate(element) {
$(element || this).closest("div.ui-btn").animate({ opacity: 0 }, 500, function() { $(this).closest("div.ui-btn").animate({ opacity: 1 }, 500, pulsate); });
}