JSFiddle - React, Tailwind, and code Playground
HTML
<div class="image1">
<p>Hover for cat 1</p>
</div>
<div class="image2">
<p>Hover for cat 2</p>
</div>
<div class="image3">
<p>Hover for cat 3</p>
</div>
<div class="default">
<p>Default Text</p>
</div>
<div id="cats">
<p class="cat1">Category 1 text</p>
<p class="cat2">Category 2 text</p>
<p class="cat3">Category 3 text</p>
</div>
CSS
.cat1 {
display: none;
}
.cat2 {
display: none;
}
.cat3 {
display: none;
}
* {
font-size: 20px;
text-align: center;
}
.image1, .image2, .image3 {
float: left;
width: 150px;
border: thin solid #CCC;
margin-bottom: 20px;
}
#cats, .default {
width: 450px;
}
JavaScript
$(document).ready(function() {
$(".image1").mouseout(function() {
$(".default").show();
$(".cat1").hide();
}).mouseover(function() {
$(".default").hide();
$(".cat1").show();
});
$(".image2").mouseout(function() {
$(".default").show();
$(".cat2").hide();
}).mouseover(function() {
$(".default").hide();
$(".cat2").show();
});
$(".image3").mouseout(function() {
$(".default").show();
$(".cat3").hide();
}).mouseover(function() {
$(".default").hide();
$(".cat3").show();
});
});