JSFiddle - React, Tailwind, and code Playground
HTML
<div id="image">
<div id="text">My text</div>
</div>
CSS
#image {
position:relative;
width:300px;
height:300px;
background:#f5f5f5;
border:#e4e4e4 1px solid;
cursor:pointer;
}
#text {
display:none;
position:absolute;
bottom:0;
width:100%;
background:#444;
color:#fff;
}
JavaScript
$(document).ready(function() {
$(document).on('click', '#image', function() {
$('#text').slideToggle(200);
});
});