jquery code to add required attribute code example Example: jquery add required $("input").prop('required',true);