不会做 求解啊、各位队友 怎么写的
<script type="text/javascript">
var Li=document.getElementsByTagName("li");
for(var i = 0;i<Li.length; i++){
Li[i].nodeName="li";
Li[i].nodeValue="li";
Li[i].nodeType="li";
document.write(Li[i]+"<br>");
}
</script>
<script type="text/javascript">
var Li=document.getElementsByTagName("li");
for(var i = 0;i<Li.length; i++){
Li[i].nodeName="li";
Li[i].nodeValue="li";
Li[i].nodeType="li";
document.write(Li[i]+"<br>");
}
</script>
2019-05-08
<!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 t=document.getElementsByTagName("li");
for(var i=0;i<t.length;i++)
{
var j=i+1;
document.write("第"+j+"个结点的nodeName:"+t[i].nodeName+" "+"nodeValue:"+t[i].nodeValue+" "+"nodeType:"+t[i].nodeType+"<br/>");
}
</script>
</body>
</html>
举报