JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<style>
.content {
display: none;
}
</style>
<script>
function showHide(element) {
sibling = element.nextElementSibling;
if (sibling.style.display == "none")
sibling.style.display = "block"
else sibling.style.display = "none";
}
</script>
</head>
<body>
<h1 onclick="showHide(this)">Foo</h1>
<div class="content">
Foo Content
</div>
<h1 onclick="showHide(this)">Bar</h1>
<div style="display: none;">
Bar Content
</div>
</body>
</html>