JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrapper">
<div class="container1">
This is the Element i want to toggle
</div>
<div class="container2">
<a href="#" class="button">Click</a>
</div>
</div>
JavaScript
$(function(){
$('.button').click(function(){
$(this)
.parent()
.siblings()
.first()
.toggle()
});
})