Skip to main content

Bug Tracker

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

Attachments (0)
Change History (2)

Changed November 17, 2010 01:04AM UTC by snover comment:1

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.

Changed November 17, 2010 02:24AM UTC by anonymous comment:2

What's the difference between a property and an attribute?

I think that fact should be mentioned in the documentation.