JSFiddle - React, Tailwind, and code Playground

by DannyEnglander

HTML

<div class="foo">
  <h2>Hello</h2>
</div>

CSS

.foo {}

JavaScript

if ($('.foo').length) {
// test to see if an element with the class, .foo exists on the page.
  alert('hello');
  $('body').addClass('bar');
}