JSFiddle - React, Tailwind, and code Playground

by digitalextremist

HTML

<input type="checkbox" value="checking">

<div class="box1">
    <a href="#" class="open-box">Show next box</a>
    <div class="box2"></div>
</div>

CSS

.box1 {
   background-color:yellow;
    width:400px;
    height:100px;
    display:none;
}

.box2 {
   background-color:red;
    width:200px;
    height:100px;
    display:none;
}

JavaScript

$('input[type="checkbox"]').click(function(){
    if($(this).attr("value")=="checking"){
    $(".box1").toggle();
    }
});

$('.open-box').click(function() {
    $(".box2").slideToggle();
});