#11634 closed bug (invalid)
$("td[innerHTML='xyz']"). no longer works
Reported by: | Owned by: | ||
---|---|---|---|
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 11 years ago by
Component: | unfiled → selector |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 11 years ago by
Status: | pending → new |
---|
I added a test case on jsFiddle...
The test case works with 1.6.4 but not with anything newer (including jQuery edge).
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
innerHTML
is a DOM Node property, not an HTML markup attribute. This may have worked, but only by coincidence.
comment:4 Changed 11 years ago by
The correct way to select nodes based on their contents is with :contains(), see: http://jsfiddle.net/rwaldron/VnRuU/5/
comment:5 Changed 11 years ago by
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.
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.