JSFiddle - React, Tailwind, and code Playground

by niklasvh

HTML

<div id="uniqueDiv1" class="frame">
    <a href="#" class="hide">Hide</a> 
        <div class="data">
            <pre>data</pre>          
        </div>
</div>

<div id="uniqueDiv2" class="frame">
    <a href="#" class="hide">Hide</a> 
        <div class="data">
            <pre>data</pre>           
        </div>
</div>

JavaScript

$('div.frame a.hide').click(function(e){
   e.preventDefault();
   var div =$(this).next('div.data').slideToggle(); 
    if ($(this).text()=='Show'){
     $(this).text('Hide');   
    }else{
     $(this).text('Show');   
    }
});