JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" class="hoverlink" id="what" data-mouseover="Hovering over what" data-mouseout="Do something">Do something</a>
<br />
<a href="#" class="hoverlink" id="what1" data-mouseover="Hovering over what1" data-mouseout="Do something else">Do something else</a>
JavaScript
$(".hoverlink").bind("mouseover mouseout", function(e) {
var elem = $(this);
var text = elem.data(e.type); // e.type will have name of the current event
elem.animate({"opacity": 0}, 500, function() {
elem.text(text);
}).animate({"opacity": 1}, 500);
});