JSFiddle - React, Tailwind, and code Playground
by jalxob
HTML
<input type="checkbox" value="checking"> <a href="#" class="open-box">Show next box</a>
<div class="box1"></div>
CSS
.open-box {
display:none;
}
.box1 {
background-color:red;
width:200px;
height:100px;
display:none;
}
JavaScript
$('input[type="checkbox"]').click(function(){
if($(this).attr("value")=="checking"){
$(".open-box").toggle();
}
});
$('.open-box').click(function() {
$(".box1").slideToggle();
});