Skip to content

removeClass() with empty arguments does not remove all classes #2

Description

@gmcnaughton

Per the jQuery docs, calling removeClass() with no arguments should remove all classes:

If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.

However with the regexp monkey-patch in place, this gets broken:

$('body').removeClass(); // doesn't remove anything!

Changing line 19 from call to apply fixes the zero-argument case:

removeClass.apply(this, arguments);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions