JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
<button type="button">Click to toggle</button>
<div class="testClass">
A div with class="testClass".
</div>
<div class="testClass">
The second div with the same class name.
</div>
<p class="testClass">
A paragraph with testClass
</p>
JavaScript
$("button").click(function(){
$('.testClass').toggle();
});