<!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 lis=document.getElementsByTagName("li");
var i=0;
for(i=0;i<lis.length;i++)
{
var inn=lis[i].innerHTML;
x=inn[i].nodeValue;
document.write(x+"<br/>")
}
</script>
</body>
</html>
<!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 lis=document.getElementsByTagName("li");
var i=0;
for(i=0;i<lis.length;i++)
{
//var inn=lis[i].innerHTML; //这里已经获取到lis数组的里面的内容了
//x=inn[i].nodeValue;
x=lis[i].nodeValue;
document.write(x+"<br/>")
}
</script>
</body>
</html>
你的for循环少了分号,加上就好了