Class Names

addClass()

returns itself

Adds a given css class:

rect.addClass('pink-flower')

classes()

returns array

Fetches the CSS classes for the node as an array:

rect.classes()

hasClass()

returns boolean

Test the presence of a given css class:

rect.hasClass('purple-rain')

removeClass()

returns itself

Removes a given css class:

rect.removeClass('pink-flower')

toggleClass()

returns itself

Toggles a given css class:

rect.toggleClass('pink-flower')
Fork me on GitHub