JSFiddle - React, Tailwind, and code Playground

by fkling

HTML

<div data-background="red" class="item">Hover me!</div>

JavaScript

(function() {
    var bg;
    jQuery('.item').hover(
    function() {
        bg = jQuery(this).data('background');
        jQuery(this).css("background-color", bg);
    }, function() {
        alert(bg);
    });
}());