Changing Multiple Attribute Properties in jQuery
Similar to the attr method, we can change the values of several properties at once; to do this, they need to be passed as an object.
Let's say we have the following checkbox:
<input type="checkbox" class="aaa" id="test" />
Let's change the properties for className and disabled at the same time.
$("#test").prop({ className: 'bbb', disabled: 'true' });
HTML the code will look like this:
<input type="checkbox" class="bbb" id="test" disabled>
Also similar to the attr method, we can apply a function to each property.