<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>节点属性</title>
</head>
<body>
<ul>
<li>javascript</li>
<li>HTML/CSS</li>
<li>jQuery</li>
</ul>
<script type="text/javascript">
var allNodes=document.getElementsByTagName("li");
//document.write(allNodes.length);
for(var i=0;i<allNodes.length;i++)
{
//document.write(i+"<br />");
document.write("li["+i+"]:"+allNodes[i].nodeName+"<br />");
document.write(allNodes[i].nodeValue+"<br /");
document.write(allNodes[i].nodeType+"<br /")
}
</script>
</body>
</html>
换行符<br/>书写错误