Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12396 closed bug (invalid)

.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/

Change History (2)

comment:1 Changed 7 years ago by gibson042

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.

comment:2 Changed 7 years ago by simonpstevens

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.

Note: See TracTickets for help on using tickets.