JSFiddle - React, Tailwind, and code Playground

HTML

<div id="defdiv" class="hoverme">
    this is default div. Hover here to change background color.
</div>
<br /><br />
<a href="#" id="clickme">now click here to dynamically create new div</a>

CSS

.hoverme{ padding:5px; margin:5px; width:150px; height:70px; background-color:#0af;      color:#fff; }

JavaScript

$("body").on('hover', '.hoverme', function(e) {
        if (e.type === 'mouseenter') {
            $(this).css({backgroundColor: '#000'}); 
        }
        else {
            $(this).css({backgroundColor: '#0af'}); 
        }             
    });

$("#clickme").click(function()
{
    $("body").append("<div class='hoverme'>newly created div</div>");
});