Bug Tracker

Modify

Ticket #319 (closed feature: fixed)

Opened 7 years ago

Last modified 6 years ago

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:1 Changed 7 years ago by john

  • Type changed from bug to feature

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.

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()

comment:4 Changed 6 years ago by john

  • Priority changed from minor to major
  • Version set to 1.1
  • Milestone set to 1.1

comment:5 Changed 6 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.