JSFiddle - React, Tailwind, and code Playground

by pmamode

HTML

<p class="flip">Show/Hide Panel</p><div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p>At W3Schools, you can study everything you need to learn, in an accessible and handy format.</p>
</div>
 
<p class="flip">Show/Hide Panel</p><div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p>At W3Schools, you can study everything you need to learn, in an accessible and handy format.</p>
</div>

CSS

div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}

JavaScript

$(document).ready(function(){
$(".flip").click(function(){
    $(".panel").slideToggle("fast");
  });
});