JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<ul>
<li>
<button type="button">
<img src="something.png" alt="an image for something">
<h2>Something</h2>
</button>
<p class="toggable hidden">I am hidden.</p>
</li>
<li>
<button type="button">
<img src="something.png" alt="an image for something">
<h2>Something</h2>
</button>
<p class="toggable hidden">I am hidden.</p>
</li>
</ul>
</div>
CSS
.hidden {
display: none;
}
JavaScript
$(document).ready(function() {
$("button").click(function() {
$(this).next(".hidden").slideToggle();
});
});