Skip to main content

Bug Tracker

Side navigation

#11634 closed bug (invalid)

Opened April 24, 2012 02:23PM UTC

Closed April 24, 2012 07:25PM UTC

Last modified April 25, 2012 02:14PM UTC

$("td[innerHTML='xyz']"). no longer works

Reported by: Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

in jQuery 1.6.4, I could use the selector $("td[innerHTML='xyz']") to filter on all table cells in the DOM with 'xyz' as their inner HTML value. No matter what I try, this selector does not work in 1.7+. I have read the release notes and can't find anything that references why this won't work anymore.

Attachments (0)
Change History (6)

Changed April 24, 2012 03:18PM UTC by rwaldron comment:1

component: unfiledselector
owner: →
priority: undecidedlow
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate:

Open the link and click to "Fork" (in the top menu) to begin.

Changed April 24, 2012 07:05PM UTC by comment:2

status: pendingnew

I added a test case on jsFiddle...

The test case works with 1.6.4 but not with anything newer (including jQuery edge).

Changed April 24, 2012 07:25PM UTC by rwaldron comment:3

resolution: → invalid
status: newclosed

innerHTML is a DOM Node property, not an HTML markup attribute. This may have worked, but only by coincidence.

Changed April 24, 2012 07:28PM UTC by rwaldron comment:4

The correct way to select nodes based on their contents is with :contains(), see:

Changed April 25, 2012 11:51AM UTC by comment:5

How 'bout that. Thanks for the update. I had found the original example somewhere on the web months ago and had been using it ever since not realizing it wasn't a qualified feature.

Changed April 25, 2012 02:14PM UTC by rwaldron comment:6

You're welcome! :)