Side navigation
#7538 closed bug (wontfix)
Opened November 16, 2010 11:36PM UTC
Closed November 17, 2010 01:04AM UTC
Last modified March 14, 2012 07:27PM UTC
attr("cellIndex") is undefined in XHTML
Reported by: | webmaster@tubo-world.de | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | unfiled | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There is a bug/inconsistency when trying to get the cellIndex with the .attr() method of a table cell in XHTML served as application/xhtml+xml.
According to the documentation the .attr() method is for "Cross-browser consistency" but here the reverse is true.
Test case:
$("td").attr("cellIndex");
works in text/html but undefined for XHTML in Firefox and Chrome
Workaround:
$("td").get(0).cellIndex;
works for HTML and XHTML in Firefox and Chrome
I think this bug is related to http://bugs.jquery.com/ticket/4283
.attr
explicitly avoids retrieving properties on XML documents, so you will never be able to use it in that way. We are moving away from allowing.attr
to access properties anyway, even for HTML documents, in future versions of jQuery.