showing results for - "javascript count list items"
Matteo
19 Feb 2019
1
2var myUL = document.getElementById("myUL");
3var list = myUL.children.tags("LI");
4alert(list.length);
5
6
Allison
14 Nov 2018
1var ul = document.getElementById("myul");
2var liNodes = [];
3
4for (var i = 0; i < ul.childNodes.length; i++) {
5	if (ul.childNodes[i].nodeName == "LI") {
6		liNodes.push(ul.childNodes[i]);
7	}
8}
9