Bug Tracker

Opened 11 years ago

Closed 11 years ago

#4528 closed bug (wontfix)

parent > child selector doesn't work as expected if the child tag is an id that isn't unique

Reported by: piev Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: parent, child, selector Cc:
Blocked by: Blocking:

Description

$('#id1 > #id2') does not return the existing object if its id ("id2") isn't unique.

Example:

<div id="test1">something goes here</div>

<div id="localHolding">

<div id="test1">Hello World</div>

<div id="test2">Hello Universe</div>

</div>

Then in the script section: $('#localHolding > #test1').length=0;

Note: Previous versions (1.2.6) did handle this as expected.

Attachments (1)

jquery_bug.htm (1.1 KB) - added by piev 11 years ago.
html file illustrating unexpected behaviour (bug)

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by piev

Attachment: jquery_bug.htm added

html file illustrating unexpected behaviour (bug)

comment:1 Changed 11 years ago by ajpiano

This ticket should be marked as invalid. The id attribute is required to be unique.

comment:2 Changed 11 years ago by john

Resolution: wontfix
Status: newclosed

This is going to have to be something that we'll punt on. In 1.2.6 #id1 > #id2 would fail if there were multiple #id1s, since in 1.3 we work right to left we just fail the other way around. We're going to have to pass on this, for performance reasons.

Note: See TracTickets for help on using tickets.