Modify ↓
Ticket #319 (closed feature: fixed)
Multiple Expression in .siblings(), .filter(), .not()
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.1a |
| Component: | core | Version: | 1.1a |
| Keywords: | siblings expression | Cc: | |
| Blocking: | Blocked by: |
Description
Shouldn't $('label').siblings('input,textarea').addClass('blah'); work?
$('input,textarea').addClass('blah') works (but not at the scope of items that are siblings to labels.
A work around as pointed out on the mailing list is to $('label').siblings().find('input,textarea').
$('label').siblings('input').addClass('blah').end().siblings ('textarea').addClass('blah').end(); also works for what I'm doing, but it seemed to me the expression in siblings should work the same way as an expression in $(). Am I wrong on that?
Change History
comment:2 Changed 7 years ago by john
- Summary changed from siblings() expression doesn't work the same way as $() expressions to Multiple Expression in .siblings() and .filter()
comment:3 Changed 6 years ago by john
- Summary changed from Multiple Expression in .siblings() and .filter() to Multiple Expression in .siblings(), .filter(), .not()
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Maybe this can be, internally, reduced to allowing jQuery.filter() take an array of expressions to filter against? That way just a str.split(',') can be passed in, where necessary.