Opened 11 years ago
Closed 11 years ago
#12380 closed feature (wontfix)
array as argument for addClass, removeClass
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | attributes | Version: | 1.8.0 |
Keywords: | 1.9-discuss | Cc: | |
Blocked by: | Blocking: |
Description
It would be nice if we could just use an array as an argument for addClass and removeClass to allow multiple classes to be created at once.
I know that I can pass multiple classes as a string but that doesn't help me much.
I am using this at the moment:
$(element).addClass(['bla','blubb','wuff'].join(' '));
Thanks for considering! :-)
Change History (8)
comment:1 Changed 11 years ago by
Component: | unfiled → misc |
---|---|
Keywords: | 1.9-discuss added |
Priority: | undecided → low |
Status: | new → open |
Type: | feature → enhancement |
comment:2 Changed 11 years ago by
Type: | enhancement → feature |
---|
Bulk change from enhancement to feature.
comment:4 Changed 11 years ago by
-1, It's really easy to do yourself and a signature like this isn't consistent with others.
comment:5 Changed 11 years ago by
Pull request here if we decide to land for 1.9: https://github.com/jquery/jquery/pull/988
comment:7 Changed 11 years ago by
Component: | misc → attributes |
---|
comment:8 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | open → closed |
Note: See
TracTickets for help on using
tickets.
We had discussed this, but if it was added to add/removeClass, it would then need to propagate throughout all similar functions, which may not be worth the size. Still, I'll add it for 1.9 discussion.