how to add required property in input using javascript code example
Example: javascript add required to input
element.setAttribute("required", "");
element.removeAttribute("required");
element.setAttribute("required", "");
element.removeAttribute("required");