Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7897 closed bug (invalid)

Descendant id selector bug in IE when running in IE7 mode

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone:
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


Descendant id selector does not work in IE when running in IE7 mode (http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx).
In the example @ http://jsfiddle.net/riaanl/TGwGW/, the selector ('#uiContainerX #txtName') to find the first input #txtName in #uiContainerX works; But when trying to access the other input #txtName with selector '#uiContainerX #txtName' does not work and returns an unexpected object.

Expected Result:
$('#uiContainerX #txtName').attr('id') >> txtName
$('#uiContainerY #txtName').attr('id') >> txtName
$('#uiContainerY [id=txtName]').attr('id') >> txtName
$('#txtName', '#uiContainerY').attr('id') >> txtName

The result in ie with IE7 mode ON:
$('#uiContainerX #txtName').attr('id') >> txtName
$('#uiContainerY #txtName').attr('id') >> undefined
$('#uiContainerY [id=txtName]').attr('id') >> txtName
$('#txtName', '#uiContainerY').attr('id') >> txtName

Change History (3)

comment:1 Changed 12 years ago by [email protected]

to replicate the issue, one must add

<meta http-equiv="X-UA-Compatible" content="IE=7.5" />

to the head section of the page.

comment:2 Changed 12 years ago by jitter

Milestone: 1.6
Owner: set to [email protected]
Status: newpending

Thanks for taking the time to contribute to the jQuery project by writing a bug report. Your test case contains invalid html as there are two elements with the same id "txtName" which isn't allowed (http://www.w3.org/TR/html5/elements.html#the-id-attribute)

Please report back if you can provide a test case with valid html which still reproduces the error described.

comment:3 Changed 12 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.