JSFiddle - React, Tailwind, and code Playground
HTML
<p id="toggle">
<span> Left </span>
<span> Right </span>
</p>
<div id="left"> LEFT CONTENT </div>
<div id="right"> RIGHT CONTENT </div>
CSS
#right { display:none; }
JavaScript
$('#toggle > span').click(function() {
var ix = $(this).index();
$('#left').toggle( ix === 0 );
$('#right').toggle( ix === 1 );
});