JSFiddle - React, Tailwind, and code Playground

by doug65536

JavaScript

var elements, i, nlen, elem, cname, oinput;
elements = $("#" + cform + " :input");
console.log(elements.length + " input fields");
elements.each(function () {
    elem = $(this);
    cname = elem.attr('name');
    console.log(cname);
    if (elem.hasClass('required')) {
        console.log("req" + cname);
        oinput = oel.prev("label");
        alert(oinput.length);
        if (oinput.length > 0) {
            oinput.text(oinput.text() + '*');
            console.log("label " + oinput[0]);
        }
    }
});