JSFiddle - React, Tailwind, and code Playground

by Pris Wiz

HTML

<div>
    <div id="di1">This is the first one.
            <input id="i2" type="button" value="two" />

    </div>
    
    
    <div id="di2">And here we have number two.
    <input id="i1" type="button" value="one" />
    </div>
</div>

CSS

div #di2 {
    display: none;}

JavaScript

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