Answers for "js loop ul"

0

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
}
Posted by: Guest on January-21-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language