JSFiddle - React, Tailwind, and code Playground

by Bala_chandran

HTML

<p class="tct-button2">Click to toggle</p>
<p class="tct-button2">highlight</p>
<p class="tct-button2">on these</p>
<p class="tct-button2">paragraphs</p>

CSS

.tct-button2 {
    background: yellow;
  }
.tct-button {
    background: red;
  }

JavaScript

$( "p" ).click(function() {
  $( this ).toggleClass( "tct-button2 tct-button" );
});