JSFiddle - React, Tailwind, and code Playground

by MD. AL-AMIN

HTML

<fieldset>
    <p>
       <label>SOME LABEL</label><span class="required"> *</span>
    </p>
    <input type="text" id="txtBox">
</fieldset>

CSS

.missing{
    color:red;
}

JavaScript

$(function(){
   $('#txtBox').parent().find('span.required').addClass('missing'); 
});