Skip to main content

Bug Tracker

Side navigation

#7897 closed bug (invalid)

Opened January 04, 2011 09:30PM UTC

Closed January 22, 2011 08:08AM UTC

Descendant id selector bug in IE when running in IE7 mode

Reported by: Owned by:
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 (

In the example @, 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

Attachments (0)
Change History (3)

Changed January 04, 2011 09:35PM UTC by comment:1

to replicate the issue, one must add

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

to the head section of the page.

Changed January 08, 2011 03:51AM UTC by jitter comment:2

milestone: 1.6
owner: →
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 (

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

Changed January 22, 2011 08:08AM UTC by trac-o-bot comment:3

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!