JSFiddle - React, Tailwind, and code Playground

HTML

<div id="nav">
    <a href="" id="#content1">Show content 1</a>
    <a href="" id="#content2">Show content 2</a>
    <a href="" id="#content3">Show content 3</a>
</div>

<div id="contents" style="width: 200px; height: 40px; border: dotted; margin-top: 20px;">
<div id="defaultcontent" class="toggle">Default Content</div>
<div id="content1" class="toggle" style="display:none">show the stuff1</div> 
<div id="content2" class="toggle" style="display:none">show the stuff2</div>
<div id="content3" class="toggle" style="display:none">show the stuff3</div>
</div>

JavaScript

$("#nav a").click(function(e){
     e.preventDefault();
     $(".toggle").hide();
     var toShow = $(this).attr('id');
     $(toShow).show();
     });