qq_笛_0
2016-03-24 19:45
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<ul id="test">
<li>JavaScript</li>
<li>HTML</li>
</ul>
<script type="text/javascript">
var otest = document.getElementById("test");
var newnode=documeng.createElement("li");
newnode.innerHTML="PHP";
otest.appendChild(newnode);
var l=document.getElementsByTagName("li");
for(var i=0;i<l.length;i++){
alert(l[i].innerHTML);
}
</script>
</body>
</html>
var newnode=documeng.createElement("li");
改下就行document
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题