-
Notifications
You must be signed in to change notification settings - Fork 0
.toggleModifier()
esr360 edited this page May 1, 2019
·
2 revisions
Toggle one or more modifiers to each element in the set of matched elements (add the modifier if not already present/remove the modifier if present)
.toggleModifier(modifier, config);
.toggle()
.toggleModifiers()
Param | Type | Info |
---|---|---|
modifier |
(String|Array) |
The modifier(s) to toggle on each element in the set of matched elements |
[config] |
Object |
The configuration to use when calling the method (learn more) |
<div class="button" id="alpha">Button</div>
sQuery('#alpha').toggleModifier('active');
<div class="button-active" id="alpha">Button</div>
<div class="button" id="alpha">Button</div>
Note the use of
.toggleModifiers()
alias
sQuery('#alpha').toggleModifier(['disabled', 'error']);
<div class="button-disabled-error" id="alpha">Button</div>