"Camet" <> writes:
> I do not know what you mean by parentNode in relation to tables. I
> have only used those in relation to reading xml files.
The XML files are probably read into a W3C DOM structure. The same
thing happens with HTML in a browser, and there is a ECMAScript
binding for the DOM objects and methods that specifies how to use
it:
<URL:http://www.w3.org/TR/DOM-Level-2-HTML/ecma-script-binding.html>
In this case, you can do something like:
function findRowNumber(element) { // element is a descendent of a tr element
while(element.tagName.toLowerCase() != "tr") {
element = element.parentNode; // breaks if no "tr" in path to root
}
return element.rowIndex;
}
and call it when clicking on the table:
<table
onclick="doSomethingWith(findRowNumber(event.targe t||event.srcElement));">
...
</table>
/L
--
Lasse Reichstein Nielsen -
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'