JavaScript -Zähllistenelemente
var myUL = document.getElementById("myUL");
var list = myUL.children.tags("LI");
alert(list.length);
Ugliest Unicorn
var myUL = document.getElementById("myUL");
var list = myUL.children.tags("LI");
alert(list.length);
var ul = document.getElementById("myul");
var liNodes = [];
for (var i = 0; i < ul.childNodes.length; i++) {
if (ul.childNodes[i].nodeName == "LI") {
liNodes.push(ul.childNodes[i]);
}
}