Skip to content

Missing documentation for .toggleClass( [state] ) #781

@rosenfeld

Description

@rosenfeld

The documentation here is insufficient:

http://api.jquery.com/toggleclass/#toggleClass-state

Also, the current behavior does not seem consistent from what one might expect by looking at the other signatures:

https://jsfiddle.net/jdoedx2v/4/

It seems the behavior of toggleClass() and toggleClass(true) are the same. I'd expect toggleClass(true) to always restore the original classes from the first call the same way as toggleClass(false) would always remove all original classes. But maybe I'm missing something because there's no proper documentation and I couldn't understand the real intention here...

Metadata

Metadata

Assignees

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