Looping melalui elemen Li di 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
}
Meandering Meerkat