var otest = document.getElementById("test"); var old =document.getElementsByTagName("li")[1]; var new =document.createElement("li"); new.innerHTML="PHP"; otest.insertBefore(new,old);
new是js关键字,不能作为变量名哦
new 是关键字啦,改下就好
new 是js关键字