var otest = document.getElementById("test");
var newnode=document.createElement("li");
newnode.innerHTML="php";
otset.insertBefore(newnode,otest.childNodes[0]);
你这最后一行把otset改成otest,醉了
var otest = document.getElementById("test");
var newnode = document.createElement("li");
newnode.innerHTML="PHP";
var node = otest.childNodes[1];//是那个狐族小标错了
otest.insertBefore(newnode,node);