为什么我输出没有结果,感觉自己代码是正确的
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<div>
javascript
<p>javascript</p>
<div>jQuery</div>
<h5>PHP</h5>
</div>
<script type="text/javascript">
var arr=document.getElementsByTagName("div")[0].childNodes;
for(i=0;i<arr.length;i++){
document.write("第"+(i+1))+"个元素子节点"+arr[i].nodeName);
document.write("第"+(i+1))+"元素子节点"+arr[i].nodeValue);
document.write("第"+(i+1))+"元素子节点"+arr[i].nodeType);
}
</script>
</body>
</html>