stay123
2015-01-25 14:34
<!DOCTYPE HTML>
<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 fnod=document.getElementsTagName("div")[0].childNodes;
for(var i=0;i<fnod.length;i++)
{ document.write("节点类型:"+fnod[i].nodeName+" "+fnod[i].nodeType+" "+fnod[i].nodeValue+"<br/>");
}
</script>
</body>
</html>
知道了。。。少了By
JavaScript进阶篇
468193 学习 · 21891 问题
相似问题