Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3694 closed bug (invalid)

class selector bug in find()

Reported by: janis.zalitis Owned by:
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc: janis.zalitis
Blocked by: Blocking:

Description

When using find() to filter out elements of collection that have certain class, I get an empty array. Dumping the collection shows the elements with that class are there, yet fin() ignores them.

Attachments (1)

JQuery_find_test_case.zip (80.2 KB) - added by janis.zalitis 15 years ago.
Test case using 3 sets of two images and using find to filter images for hiding.

Download all attachments as: .zip

Change History (4)

Changed 15 years ago by janis.zalitis

Attachment: JQuery_find_test_case.zip added

Test case using 3 sets of two images and using find to filter images for hiding.

comment:1 Changed 15 years ago by flesler

Cc: janis.zalitis added
Component: coreselector
need: PatchReview
Resolution: invalid
Status: newclosed

Both the 2nd and 3rd example are wrong, you're looking for .grey inside img.grey. So it's obviously not going to find it.

Next time, post something like this to jQuery's google group.

comment:2 Changed 15 years ago by janis.zaliti

Wait, the code is as follows:

var pics2 = $('div.item2').find('img') $(pics2).find('.grey').hide()

In the first line I get the collection of "img" and then I'm trying anything that has a class "grey" in that collection.

comment:3 Changed 15 years ago by flesler

No, that's not how to do that. Check the docs or ask at the G group.

Note: See TracTickets for help on using tickets.