JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="hello" class="test" />

JavaScript

var element = document.getElementsByClassName("test")[0].id;

if (element === "hello") {
   alert("Working"); 
}