Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7538 closed bug (wontfix)

attr("cellIndex") is undefined in XHTML

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


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


$("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

Change History (2)

comment:1 Changed 12 years ago by snover

Resolution: wontfix
Status: newclosed

.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.

comment:2 Changed 12 years ago by anonymous

What's the difference between a property and an attribute? I think that fact should be mentioned in the documentation.

Note: See TracTickets for help on using tickets.