JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" onclick="toggler('myContent');">this is a test</a>
<div id="myContent" class='hidden'>
<div>this is a test #1 </div>
</div>
CSS
.hidden {
display:none;
}
JavaScript
function toggler(divId) {
$("#" + divId).toggle();
}