<script type="text/javascript"> var otest = document.getElementById("test"); var newnode = document.createElement("li"); newnode.innerHTML = "PHP"; otest.insertBefore(newnode,otets.lastChild); </script>
otets.lastChild写错了,应该是otest.lastChild
otest.insertBefore(newnode, otest );