数据源:
- 脚本之家
- www.jb51.net
- www.kanshule.com
<script> <BR>document.write("<strong>取外层ul的li信息:<br>"); <BR>var tree1 = document.getElementsByTagName("ul")[0].childNodes; <BR>for (var i = 0;i < tree1.length;i++){ <BR>document.write(tree1[i].innerHTML); <BR>} <br><br>document.write("<br><br><strong>取内层ul的li信息:<br>"); <br><br>var tree2 = document.getElementsByTagName("ul")[1].childNodes; <BR>for (var i = 0;i < tree2.length;i++){ <BR>document.write(tree2[i].innerHTML); <BR>} <br><br></script>