JSFiddle - React, Tailwind, and code Playground

HTML

<div id="main" style="border:1 px dashed red;" >
  <div id="1" style="width:300px;height:50px; ">div One visible</div>
  <div id="2" style="display:none;width:300px;height:50px; ">div two visible</div>
</div>

<a href="#" id="button">click</a>

JavaScript

$(document).ready(function() {
    $("#button").click(function(event) {
        $("#1").toggle();
        $("#2").toggle();
    })
});