<!doctype html><html><head><meta charset="utf-8"></head><body><ul id="id-func-buttons"><li>看图片</li><li>看小说</li><li>看视频</li><li>听音乐</li></ul><script>window.onload = function(){forEachList_1 = function(element){lis = element.getElementsByTagName("li");for(var i=0; i<lis.length; i++){var node = lis.item(i);console.log("forEachList_1", node.innerHTML);}}forEachList_2 = function(element){lis = element.children;for(var i=0; i<lis.length; i++){var node = lis[i];console.log("forEachList_2", node.innerHTML);}}var list = document.getElementById("id-func-buttons");forEachList_1(list);console.log("=====================")forEachList_2(list);}</script></body></html>
100字范文,内容丰富有趣,生活中的好帮手!