1element.setAttribute("required", ""); //turns required on
2element.required = true; //turns required on through reflected attribute
3jQuery(element).attr('required', ''); //turns required on
4$("#elementId").attr('required', ''); //turns required on
5
6element.removeAttribute("required"); //turns required off
7element.required = false; //turns required off through reflected attribute
8jQuery(element).removeAttr('required'); //turns required off
9$("#elementId").removeAttr('required'); //turns required off
10
11if (edName.hasAttribute("required")) { } //check if required
12if (edName.required) { } //check if required using reflected attribute
13