Multiple Expression in .siblings(), .filter(), .not()
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 (5)
Summary: |
siblings() expression doesn't work the same way as $() expressions →
Multiple Expression in .siblings() and .filter()
|
Summary: |
Multiple Expression in .siblings() and .filter() →
Multiple Expression in .siblings(), .filter(), .not()
|
Milestone: |
→ 1.1
|
Priority: |
minor →
major
|
Version: |
→ 1.1
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
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.