Skip to content

Misleading documentation for toggleClass() method. #1696

@tilwinjoy

Description

@tilwinjoy

The third variation of toggleClass method in documentation is as follows:
.toggleClass( [switch ] )
switch
Type: Boolean
A boolean value to determine whether the class should be added or removed.

It says "the" class, while no particular class is specified, and it toggles all the class names present in the matched elements.

it would be great if the documentation reads the same.

As a side note:

Also, at later point, the docs says:

if no arguments are passed to .toggleClass(), all class names on the element the first time .toggleClass() is called will be toggled.

It would be nice if it is added as the first variant of the method, along with a better description other than "all class names on the element the first time .toggleClass() is called will be toggled"? " Something like "all class names that were present on the element when .toggleClass() is called for the first time will be toggled" will be better IMHO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions