JSFiddle - React, Tailwind, and code Playground

HTML

<div id="top">
  top
</div>
<div id="bottom">
  bottom
</div>
<a id="btn">
toggle
</a>

CSS

body.toggled #bottom {
  color:red;
}
body.toggled #top {
  display: none;
}

JavaScript

$("#btn").click(function() {
  $('body').toggleClass('toggled');
});