How to add attribute data-val-required if it is removed dynamically using jquery

849 Views Asked by At

I want to remove attribute on some condition so i used this

$("#tab-1").removeAttr("data-val-required");

But now on some conditions i want to make it required again i have used this but it doesnt work

$("#tab-1").rules("add", "required")
0

There are 0 best solutions below