#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)
Change History (4)
Changed 15 years ago by
Attachment: | JQuery_find_test_case.zip added |
---|
comment:1 Changed 15 years ago by
Cc: | janis.zalitis added |
---|---|
Component: | core → selector |
need: | Patch → Review |
Resolution: | → invalid |
Status: | new → closed |
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
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
No, that's not how to do that. Check the docs or ask at the G group.
Test case using 3 sets of two images and using find to filter images for hiding.