<body>
<ul id="test"><li>JavaScript</li><li>HTML</li></ul>
<script>
var otest = document.getElementById("test");
var oli = otest.childNodes[0];
var nli = document.createElement('li');
nli.innerHTML= 'php';
for(var i=0;i<oli.length;i++){
if(oli[i].innerHTML=='HTML'){
oli.insertBefore(nli,oli[i]);
}
}
</script>
</body>