JSFiddle - React, Tailwind, and code Playground

by shaneblake

HTML

stuff to always show
<div class="moreLess">stuff to hide...</div><br>
<div class="moreLessSwitch">[+] More</div>

JavaScript

$(function() {     
    $(".moreLess").hide();
     
    $(".moreLessSwitch").toggle(function() {             
        $(this).html("[-] Less");            
        $(this).prevAll(".moreLess").slideDown();         
    }, function() {            
        $(this).html("[+] More");            
        $(this).prevAll(".moreLess").slideUp();        
    }); 
});