关于使用getElementsTagName不能实现效果
<!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 xinli = document.createElement("li");
xinli.innerHTML="PHP";
var yuanli =document.getElementsTagName("li")[1];
otest.insertBefore(xinli,yuanli);
</script>
</body>
</html>