# Problem with looping thru a html page

**URL:** <https://forum.kirupa.com/t/problem-with-looping-thru-a-html-page/68951>\
**Category:** web dev\
**Created:** [October 30, 2004, 4:26pm UTC](https://forum.kirupa.com/t/problem-with-looping-thru-a-html-page/68951 "2004-10-30T16:26:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icestream](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@icestream](https://forum.kirupa.com/u/icestream)\
**Post date:** [October 30, 2004, 4:26pm UTC](https://forum.kirupa.com/t/problem-with-looping-thru-a-html-page/68951/1 "2004-10-30T16:26:21Z")

</div>

Hi,

I trying to build a menu build out of an unordered list. There for I have the following html code:

```auto

<ul id="nav">
        <li>Sunfishes 
          <ul>
            <li><a href="">Blackbanded sunfish</a></li>
            <li><a href="">Shadow bass</a></li>
            <li><a href="">Ozark bass</a></li>
            <li><a href="">White crappie</a></li>
          </ul>
        </li>

        <li>Grunts 
          <ul>
            <li><a href="">Smallmouth grunt </a></li>
            <li><a href="">Burrito</a></li>
            <li><a href="">Pigfish</a></li>
          </ul>
        </li>

        <li>Remoras 
          <ul>
            <li><a href="">Whalesucker</a></li>
            <li><a href="">Marlinsucker</a></li>
            <li><a href="">Ceylonese remora</a></li>
            <li><a href="">Spearfish remora</a></li>
            <li><a href="">Slender suckerfish</a></li>
          </ul>
        </li>
        <li>About </li>
</ul>

```

Accessing the menu bar works fine. document.getElementById(“Nav”).childNodes

But now I’m trying to access the childnodes of a menubar item but unfortunately javascript doesn’t allows two childnodes next to eachother.

document.getElementById(“Nav”).childNodes.chilNodes

So this causes my problem with accessing the inner menu items. Is there someone with a suggestion?
