JSFiddle - React, Tailwind, and code Playground

by praveen_jegan

HTML

<tr>
    <td class="vb"> <b>NAME:<span class="formvalidation"> *</span></b>

    </td>
    <td class="vb"> <span dir="none">
        <input name="xyz" type="text" maxlength="255" id="fc95c5086638_ff3_new_ctl00_ctl00_TextField" title="NAME" class="long spellcheck-true"><br>
        <span class="formvalidation">
            <span role="alert">You must specify a value for this required field.</span>
        <br>
        </span>
        </span>
    </td>
</tr>
<tr>
    <td class="vb"> <b>NAME:<span class="formvalidation"> *</span></b>
    </td>
    <td class="vb"> <span dir="none">
        <input name="abc" type="text" maxlength="255" id="fc95c5086638_ff3_new_ctl00_ctl00_TextField" title="NAME" class="long spellcheck-true"><br>
       </span>

    </td>
</tr>

JavaScript

$("span[dir='none']").each(function () {
    var spa = $(this).find('input');
    if (spa.length == 1) {
        spa.each(function () {
            $(this).addClass('newClass');
        });
    }
});