RobB wrote:[color=blue]
> abs wrote:[color=green]
> > Anybody has an idea how to get the <ul> element which is not nested[/color]
> in <li>[color=green]
> > element ? In other words I have several lists like this:
> >
> > <ul id="1">
> > <li>Aaaaaaaa</li>
> > <li>Bbbbbbbb</li>
> > <li>Cccccccc
> > <ul>
> > <li>111111</li>
> > <li>222222</li>
> > <li>333333
> > <ul>
> > <li>@@@@@@@@@</li>
> > <li>{{{{{{{}</li>
> > <li>????>>>>></li>
> > </ul>
> > </li>
> > </ul>
> > </li>
> > </ul>
> >
> > <ul id"2">
> > <li>qqq</li>
> > <li>vvvv</li>
> > </ul>
> >
> > and I want to get the <ul>s which have id "1" and "2" in this[/color][/color]
example[color=blue]
> but I[color=green]
> > can't use ids to get them.[/color]
>
> Hmm...very mysterious. Oh, well...any chance we could see the rest of
> your document structure - not just that subtree?
>
> var i = 0,
> ul,
> unnested_uls = [],
> all_uls = document.getElementsByTagName('ul');
> while (ul = all_uls.item(i++))
> if (null == ul.getElementsByTagName('ul'))
> unnested_uls.push(ul);
>
> ...should get you a collection of them.
>
>[/color]
http://www.webreference.com/programm.../chap17/7.html
Eesh...early morning here. Never mind.