Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js loop 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: #js #loop #ul
ADD COMMENT
Topic
Name
7+4 =