请问为什么tagName("div")后面要加[0]?
<body>
<div>
javascript
<p>javascript</p>
<div>jQuery</div>
<h5>PHP</h5>
</div>
<script type="text/javascript">
var x = document.getElementsByTagName("div")[0].childNodes;
for(var i = 0;i<x.length;i++){
document.write(x[i].nodeValue);
}
</script>
</body>