Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11634 closed bug (invalid)

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

Reported by: Geoffrey.Oliver@… Owned by: Geoffrey.Oliver@…
Priority: low Milestone: None
Component: selector Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

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.

Change History (6)

comment:1 Changed 5 years ago by Rick Waldron

Component: unfiledselector
Owner: set to Geoffrey.Oliver@…
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: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.

comment:2 Changed 5 years ago by Geoffrey.Oliver@…

Status: pendingnew

I added a test case on jsFiddle...

http://jsfiddle.net/VnRuU/

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

comment:3 Changed 5 years ago by Rick Waldron

Resolution: invalid
Status: newclosed

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

comment:4 Changed 5 years ago by Rick Waldron

The correct way to select nodes based on their contents is with :contains(), see: http://jsfiddle.net/rwaldron/VnRuU/5/

comment:5 Changed 5 years ago by Geoffrey.Oliver@…

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.

comment:6 Changed 5 years ago by Rick Waldron

You're welcome! :)

Note: See TracTickets for help on using tickets.