JSFiddle - React, Tailwind, and code Playground
HTML
<span class="bar"> </span>
<div class="test"> </div>
JavaScript
if ($("span").is(".foo, .bar")) {
$(".test").html("foo or bar exists");
};
<span class="bar"> </span>
<div class="test"> </div>
if ($("span").is(".foo, .bar")) {
$(".test").html("foo or bar exists");
};