#172 closed enhancement (fixed)
removeClass() with multiple classes
Reported by: | john | Owned by: | |
---|---|---|---|
Priority: | trivial | Milestone: | 1.1a |
Component: | core | Version: | 1.1a |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
.removeClass() and .toggleClass() multiple classes.
Change History (4)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Back when removeClass used a regexp this came for free because you could say .removeClass("(class1|class2)") to remove class1 and class2. I guess the split/splice approach was benchmarked as being a lot faster?
comment:3 Changed 16 years ago by
Type: | bug → enhancement |
---|
This was never the intended functionality of .addClass()/.removeClass()/.toggleClass(). Adding multiple classes using addClass should be deemed unexpected, and undocumented, until otherwise noted.
comment:4 Changed 16 years ago by
Milestone: | → 1.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | → 1.1 |
Resolved in SVN.
Note: See
TracTickets for help on using
tickets.
You can add multiple classes by using addClass("foo bar"), therefore removeClass should work similar, eg. removeClass("bar foo")
toggleClass would work similar:
Is there a bette way to implement those? Maybe add stuff to jQuery.className that handles multiple names and can be used by both remove and toggle?