Webanizr Logo
Open / sluit menu
Module cssClass

This module can add, remove or toggle css classes on multiple elements


webanizr.send('cssClass', data, parameters, callback);


The data is passed unaltered to the callback function. The data itself is not used.


cssClass accepts the following parameters:

name__class (required)

The name of de css class to add, remove or toggle.

query__selector (required)

The query selector to the elements to class manipulation should apply to. You can also use an DOM element as value.

type__action (optional)

The type of action that should be performed. The options are:

  • add: add given class to the selected elements
  • remove: remove the class from the select elements
  • toggle: check every element in the selection:
    • if it already has the classs: remove it
    • otherwise: add the class


The callback is called directly after the manipulations and receives the data unaltered.