JSFiddle - React, Tailwind, and code Playground

by germandost

HTML

<div class="one">Show</div>
<div class="two">hello</div>

CSS

.one{
    border: 1px solid #000;
    width: 50px;
}
.two{
    width:50px;
    height:50px;
    border: 1px solid #000;
    display:none;
}

JavaScript

$(".one").mouseover(function () {
    $(".two").show();
});
$("body").mouseover(function (e) {
    if(!($(e.target).is('.one') || $(e.target).is('.two'))){
        $(".two").fadeOut();
    }
});