javascript add required to input
snippet in javascript

javascript add required to input

user7906

element.setAttribute("required", "");

element.removeAttribute("required");