JSFiddle - React, Tailwind, and code Playground

HTML

<div id="div1"></div>
<div id="div2"></div>

CSS

#div1 {
    width: 100px;
    height: 100px;
    background-color: red;
    margin: 10px;
    float:left;
}
#div2 {
    width: 100px;
    height: 100px;
    background-color: blue;
    margin: 10px;
    float: left;
    display: none;
}

JavaScript

$('#div1, #div2').hover(function(){
    $('#div2').show();
});

$('#div1, #div2').mouseleave(function(){
    $('#div2').hide();
});