JSFiddle - React, Tailwind, and code Playground
HTML
<div id="hello1" class="hello option john">Hello</div>
<div id="hello2" class="hello no-option john">Hello</div>
JavaScript
HTMLElement.prototype.hasClass = function(c){
return this.className.split(" ").indexOf(c) > -1;
}
document.body.innerHTML +=
"<br>hello1: " + document.getElementById("hello1").hasClass("option")
document.body.innerHTML +=
"<br>hello2: " + document.getElementById("hello2").hasClass("option")