JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<div class="first">
<p> First </p>
</div>
<br>
<div class="second">
<p> Second </p>
</div>
<br>
<div class="third">
<p> Third </p>
</div>
<br>
<div class="fourth">
<p> Fourth </p>
</div>
</body>
<html>
JavaScript
$(function() {
var firstCnt = 0,
secondCnt = 0,
thirdCnt = 0,
fourthCnt = 0;
$(".first").toggle(function(){
$(".first p").text('odd');
}, function(){
$(".first p").text('even');
});
});