JSFiddle - React, Tailwind, and code Playground
by jfriend00
HTML
<div class="foo">The quick brown fox</div>
<div class="foo">jumped over the fence</div>
<div class="foo">to chase the rabbit</div>
<div class="foo">that got out of it's cage.</div>
<button id="switch">Switch Style</button>
CSS
.foo {height: 20px; margin: 10px 0; width: 200px; padding: 5px;}
.foo {background-color: #CCC; color: #000;}
.alternate .foo {background-color: #D00; color: #FFF;}
button {margin-left: 0;}
JavaScript
$("#switch").click(function() {
$(document.body).toggleClass("alternate");
});