<!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");
document.createElement("li").innerHTML = "PHP";
otest.appendChild(document.createElement("li"));
</script>
</body>
</html>
只是没有把document.createElement("li")引入变量啊,为什么就不行呢?
木子舟义
相关分类