Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Looping through LI elements in UL

var ul = document.getElementById("foo");
var items = ul.getElementsByTagName("li");
for (var i = 0; i < items.length; ++i) {
  // do something with items[i], which is a <li> element
}
Source by www.sitepoint.com #
 
PREVIOUS NEXT
Tagged: #Looping #LI #elements #UL
ADD COMMENT
Topic
Name
4+1 =