I want to remove and add required
attribute to a field according to some conditions using jQuery. This changes in DOM, but it doesn't change visually.
My code
$('#id').removeAttr('required');
$("#id").attr('ng-required','true');
$("#id").attr('required','true');
Even used .prop()
,
but nothing seemed to work.