This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10001 - For <ol> and <ul>, it would be very useful to have an array containing all top-level elements of the list, such as 'HTMLOListElement.listItems'
Summary: For <ol> and <ul>, it would be very useful to have an array containing all to...
Status: VERIFIED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 21:41 UTC by contributor
Modified: 2010-10-09 15:36 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2010-06-23 21:41:12 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#htmlolistelement

Comment:
For <ol> and <ul>, it would be very useful to have an array containing all
top-level elements of the list, such as 'HTMLOListElement.listItems'

Posted from: 129.65.20.50
Comment 1 Joseph A Thomas 2010-06-23 21:43:59 UTC
Currently, when trying to enumerate list items in a list, I am doing "list.getElementsByTagName('li')", but unfortunately this gets items from nested lists. Am I missing some easy way of doing this? (Short of visiting each child node and checking if it is an <li>)
Comment 2 Simon Pieters 2010-06-23 23:00:09 UTC
Use firstElementChild and nextElementSibling. http://www.w3.org/TR/ElementTraversal/
Comment 3 Joseph A Thomas 2010-06-24 17:27:57 UTC
Thanks for the info Simon.