JSFiddle - React, Tailwind, and code Playground

by Kumaresan S

HTML

<div id="div1">This is preview Div1. This is preview Div1.</div>
<div id="div2">This is preview Div2 to show after div 1 hides.</div>
<div id="preview">PREVIEW</div>

JavaScript

// Short-form of `document.ready`
$(function(){
    $("#div2").hide();
    $("#preview").on("click", function(){
        $("#div1, #div2").toggle();
    });
});