[thelist] [DOM] self aware nodes?
pete
pete at vex.net
Wed Aug 13 17:33:57 CDT 2003
> >I'm looking for something along the lines of a this object, I think.
>
> Assuming the button is in a TD in the TR, in JavaScript it would be
>
> this.parentNode.parentNode.rowIndex
>
> See http://www.xs4all.nl/~ppk/js/index.html?w3c_html.html#tables for an
> overview of many interesting table methods and properties, including the MS
> proprietary moveRow() method, which I think is exactly what you're looking
> for.
That's a great site, Peter - immediately bookmarked.
I guess what I was trying to do was to figure out a way to have a button
inside a TD be able to call a subroutine that could figure out which row
of the table it was called from.
The more I ponder this, the more I think it's unrealistic that this is
possible. I think it might make more sense to attempt to give each button
a unique id based on it's ordinal position.
Is it possible to set the .id and .name of a node via DOM? How about
.OnClick ?
Pete
More information about the thelist
mailing list