JSFiddle - React, Tailwind, and code Playground

HTML

<div id="linkarea">
        <a href="#" id="link-1">Content 1</a>
        <a href="#" id="link-2">Content 2</a>
       <a href="#" id="link-3">Content 3</a>
    </div>


    <div id="contentarea">
        <div id="c-1">content #1</div>
        <div id="c-2">content #2</div>
         <div id="c-3">content #3</div>
    </div>

JavaScript

$(document).ready( function(){

$('div#linkarea a').click( function(ev){
    ev.preventDefault(); // suppress natural click
    var idx = this.id.split('-')[1]; // grab the link "number"
    $('div#contentarea div[id=c-'+idx+']') // find respective div
        .show() // show it
        .siblings() // get its siblings
        .hide(); // and hide them
    });

});