JSFiddle - React, Tailwind, and code Playground

HTML

<div class="allCats">
    <h4><a href="#" class="closed">All Categories</a></h4>
</div>
<div id="allCatsContainer">
   content 2
</div>

JavaScript

$('#allCatsContainer').css("display", "none");

$('.allCats h4 a').click( function() {
    $('#allCatsContainer').slideToggle(500);
    $(this).toggleClass("openBox");  
});