<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<ul id="u"><li id="first"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li></ul>
<script>
window.onload=function(){
var ul=document.getElementById('u'),
x=document.getElementById('first');
// lis=new Array();
while (x) {
// lis.push(x.nextSibling);
document.write(x.nodeName);
x=x.nextSibling;
}
}
</script>
</body>
</html>
网页显示结果LI#textLI#textLI#textLI#textLI#textLI
ziom
相关分类