JSFiddle - React, Tailwind, and code Playground

by Mark Penner

HTML

<button id="btn">press me</button>
<div id="tt">tooltip</div>

CSS

#tt {
    background-color: red;
    width: 50px;
    height: 50px;
    display: none;
}

JavaScript

$('#btn').on('mouseover', function() {
    $('#tt').show();
}).on('mouseleave', function() {
    $('#tt').hide();
}).on('click', function() {
    $(this).remove();
});