JSFiddle - React, Tailwind, and code Playground
by j08691
HTML
<div id="foo">abc</div>
JavaScript
var val=$('#foo').html();
$(document).on('mouseenter mouseleave', '#foo', function(ev) {
$(this).html((ev.type == 'mouseenter') ? 'test' : val);
});