JSFiddle - React, Tailwind, and code Playground

HTML

<span>
    <input type="text" name="relation" class="IdRelation">
</span>

JavaScript

if ($('span').hasClass('IdRelation')) {
  alert("ok");
}