JSFiddle - React, Tailwind, and code Playground

by tebrown

HTML

<div class="statstoggle">
    
Text
    
</div>

<div class="statshidden">
    
Hidden
    
</div>

CSS

.statstoggle{list-style-type:none;}
.statstoggle:hover {list-style-type:none;background-color:#E1E1E1;cursor:pointer;}
.statshidden{display: block;margin-bottom:0px;margin-top:0px;}

JavaScript

//<![CDATA[
$('.statshidden').hide();
$(window).load(function() {
    jQuery(document).ready(function() {
        jQuery(".statstoggle").next(".statshidden").hide();
        jQuery(".statstoggle").click(function() {
            $('.active3').not(this).toggleClass('active3').next('.statshidden').slideToggle(300);
            $(this).toggleClass('active3').next().slideToggle("fast");

        });
    });
    

}); //]]>