Skip to main content

Bug Tracker

Side navigation

#12396 closed bug (invalid)

Opened August 25, 2012 11:20AM UTC

Closed August 25, 2012 11:58AM UTC

Last modified October 08, 2012 12:10PM UTC

.find() : Getting the descendants filtered by a #id selector is only returning the first children.

Reported by: blindOSX Owned by:
Priority: undecided Milestone: None
Component: traversing Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

I think the .find() function is not working properly.

Getting the descendants filtered by a #id selector is only returning the first children.

Demo: http://jsfiddle.net/blindOSX/sWeUw/

Attachments (0)
Change History (2)

Changed August 25, 2012 11:58AM UTC by gibson042 comment:1

component: unfiledtraversing
resolution: → invalid
status: newclosed

Your markup is invalid; #id selectors match at most one element because every id attribute in a document should have a unique value.

Changed October 08, 2012 12:10PM UTC by simonpstevens comment:2

It's worth noting that although this bug is invalid, the behaviour of jQuery prior to version 1.8 was to return multiple results from the find() function even when using an #Id selector.

See this example with jQuery 1.7.2

This is a potentially breaking change if code was relying on the previous incorrect behaviour of jQuery.