JSFiddle - React, Tailwind, and code Playground

by cheack

HTML

<div class="parent">
    <div class="child">text</div>
</div>
<div class="parent">
    <div class="child">text</div>
</div>
<div class="parent">
    <div class="child">text</div>
</div>

CSS

.child {
    display:none;
}

.parent {
    background: #f5f5f5;
    height:100px;
}

JavaScript

$(document).ready(function() {
    var child = $('.child');
    
    $('.parent').hover(function() {
        child.show();
    }, function() {
        child.hide();
    });
});