on-codemerge
Version:
A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product
10 lines (9 loc) • 439 B
JavaScript
class a {
addValidation(e, t) {
const i = e.querySelector("input, select, textarea");
i && (t.required && i.setAttribute("required", "true"), t.pattern && i.setAttribute("pattern", t.pattern), t.minLength && i.setAttribute("minlength", t.minLength), t.maxLength && i.setAttribute("maxlength", t.maxLength), t.min && i.setAttribute("min", t.min), t.max && i.setAttribute("max", t.max));
}
}
export {
a as ValidationManager
};