[thelist] [DOM] self aware nodes?

Peter-Paul Koch gassinaumasis at hotmail.com
Wed Aug 13 16:38:40 CDT 2003

>I'm just brushing up on my client side DOM scripting, using IE6 and
>VBScript. I've set up a proof of concept that allows you to add rows to a
>table when you click a button, by cloning a prototype, non-visible TR and
>then appending it to the TBODY.
>However, once the row is in the table, I need to be able to provide the
>ability to move the row up and down in the list, hopefully through a
>generic subrouting that calls the swapNode method.
>When I click on the button associated with the row that indicates the row
>should be moved up, I need a way to figure out the ordinal of the row that
>was clicked on, so I can figure out the ordinal of the row before it, and
>swap them.
>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


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 

ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
New: Browser Wars II: The Saga Continues

STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 

More information about the thelist mailing list