RE: Older Sibling?

> Does anyone have a specific use case for getIndexOf, for inclusion in the
> open-issue description? Or is it just being requested on the basis of
> symmetry with NodeList.item()?

I think it's a natural complement to NodeList.item(), but I've seen a number
of instances where index-based access is necessary, usually in cases where
the DOM model is adapted to fit existing frameworks.

Here's one that comes to mind immediately: When displaying a node hierarchy
in a graphical interface, it is often necessary to provide access to nodes
based on their index relative to their parent--for example, when removing a
node using an ActiveX tree control, I need to pass the parent node and the
index of the node to delete. Of course this is easy to implement yourself,
but it would be nice to have it done by the DOM implementation. And if the
implementation can optimize index-based access, that's another plus.

Received on Tuesday, 29 February 2000 13:00:06 UTC