Skip to content

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

@gmcnaughton

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);

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