Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var matches = document.getElementsByTagName("li");
- var x;
- for (x=0; x < matches.length; x++) {
- if (matches[x].getElementsByTagName('li').length > 1) {
- alert(matches[x].innerText.split('\n')[0] + " has " + matches[x].getElementsByTagName('li').length + " child items.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement