Re: An observation about "live" NodeLists

Steve -

> ...The _correct_ way of deleting all the paragraphs in a document is, of course, 
> to replace line 3 with:
> 
> 3'  for (int i = numberOfParagraphs - 1; i >= 0; i--) {

or just not deal with the indexing at all, like:

      Node n = nl.item(0);
      while( n != null )
      {  n.getParentNode().removeChild(n);
         n = nl.item(0);
      }

Right?

Mark Robinson

Received on Friday, 16 October 1998 22:00:07 UTC