JSFiddle - React, Tailwind, and code Playground

HTML

<input id="i1" type="button" value="one" />
<input id="i2" type="button" value="two" />
<div>
    <div id="di1">This is the first one.</div>
    <div id="di2">And here we have number two.</div>
</div>

CSS

div div {
    display: none;}

JavaScript

$("input").click(
        function() {
            var theId = "#d" + $(this).attr('id');
            $(theId).toggle().siblings().hide()
        }
    )