# Classes

TIP

declare function addClass(classNames: string): this;
declare function removeClass(classNames: string): this;
declare function toggleClass(classNames: string): this;

Each of these methods accepts a spaced separated string to manipulate multiple classes at once (just like using jQuery).

# LightqueryCollection#addClass

Add classes to each element.

µ(/**/).addClass("btn");  //-> this LightqueryCollection
// every item has now the class `btn`

µ(/**/).addClass("btn btn-primary"); //-> this LightqueryCollection
// every item has now both classes (`btn` and `btn-primary`)

# LightqueryCollection#removeClass

Remove classes for each element.

µ(/**/).removeClass("btn btn-primary"); //-> this LightqueryCollection
// now none of the items have any of these classes

# LightqueryCollection#toggleClass

Toggle classes for each element.

WARNING

Toggling is on a per item basis (i.e. [has, doesn't have, has] toggled will give [doesn't have, has, doesn't have]).

µ(/**/).toggleClass("active"); //-> this LightqueryCollection