innerHTML在哪章讲的?用法对吗?
<script type="text/javascript">
var otest = document.getElementById("test");
var newnode=document.createElement("li");
newnode.innerHTML="php";
var num=document.getElementsByTagName("li")
for(var i=0;i<num.length;i++){
if(num[i].innerHTML=="HTML"){
var node=num[i];
break;
}else{
node=null;
}
}
if(node==null){
document.write("emm…………<br>没有内容为HTML的li标签!");
}else{
otest.insertBefore(newnode,node);
}
</script>