how can i get all the parent <li> items within my code
<p>I have following markup:</p>

<pre><code>&lt;ul class="MenuBarVertical" id="Ul1"&gt;
            &lt;li id="MBVItem3732874"&gt;
                &lt;div class="MainMenuBarBackgrounImage"&gt;
                    &lt;a class="MenuBarItemSubmenu" href="/%D7%A7%D7%98%D7%92%D7%95%D7%A8%D7%99%D7%94%2D1.html"&gt;category 1&lt;/a&gt;&lt;/div&gt;
                &lt;ul&gt;
                    &lt;li id="SMBVItem3732879"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D1%2D1.html" tabindex="-1"&gt;page 1.1&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732880"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D1%2D2.html" tabindex="-1"&gt;page 1.2&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732881"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D1%2D3.html" tabindex="-1"&gt;page 1.3&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732882"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D1%2D4.html" tabindex="-1"&gt;page 1.4&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732883"&gt;
                        &lt;a href="/1%2D5.html" tabindex="-1"&gt;1.5&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;
            &lt;li id="MBVItem3732875"&gt;
                &lt;div class="MainMenuBarBackgrounImage"&gt;
                    &lt;a class="MenuBarItemSubmenu" href="/%D7%A7%D7%98%D7%92%D7%95%D7%A8%D7%99%D7%94%2D2.html" tabindex="-1"&gt;category 2&lt;/a&gt;&lt;/div&gt;
                &lt;ul&gt;
                    &lt;li id="SMBVItem3732884"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D2%2D1.html" tabindex="-1"&gt;page 2.1&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732885"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D2%2D2.html" tabindex="-1"&gt;page 2.2&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732886"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D2%2D3.html" tabindex="-1"&gt;page 2.3&lt;/a&gt;&lt;/li&gt;
                    &lt;li id="SMBVItem3732887"&gt;
                        &lt;a href="/%D7%A2%D7%9E%D7%95%D7%93%2D2%2D4.html" tabindex="-1"&gt;page 2.4&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;

        &lt;/ul&gt;
</code></pre>

<p>I want to display all the <code>&lt;li&gt;</code> id's of the parent UL (but at the moment it display all of the <code>&lt;li&gt;</code> within the <code>&lt;ul&gt;</code>) using java script.</p>

<p>My code is:</p>

<pre><code>window.onload = function () {
    var list = document.getElementById("Ul1");
    var items = list.getElementsByTagName("li");
    for (var i = 0, size = items.length; i &lt; size; i++) {

        alert(items[i].parnetnode.id);

    }
}
</code></pre>

<p>Can anyone please help me and let me know if there is a way to do this.</p>
