Is there a way to allow me to iterate through an ordered list similar in functionality as table.rows? I am using Javascript.
The reason I ask this is because I have an ordered list that contains another ordered list inside. I just want to return the parent list items and not the child.
<ol id="pList">
<li>Item A</li>
<li>
<ol id="cList">
<li>A's Child 1</li>
<li>A's Child 2</li>
</ol>
</li>
<li>Item B</li>
<li>Item C</li>
<li>Item D</li>
</ol>
I now use getElementsbyTag and that returns all li's including the one in cList. I just want the ones in pList.
Thanks
FYI: I would prefer it done in Javascript. The code has to work within Greasemonkey. I don't really know much about jquery and I am not really much of a javascript programmer.