Skip to main content

Bug Tracker

Side navigation

#3694 closed bug (invalid)

Opened December 06, 2008 09:30AM UTC

Closed December 07, 2008 07:31PM UTC

Last modified December 08, 2008 03:15PM UTC

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 December 06, 2008 09:32AM UTC.

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

Change History (3)

Changed December 07, 2008 07:31PM UTC by flesler comment:1

cc: → janis.zalitis
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.

Changed December 08, 2008 07:31AM UTC by janis.zaliti comment:2

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.

Changed December 08, 2008 03:15PM UTC by flesler comment:3

No, that's not how to do that.

Check the docs or ask at the G group.