按左边的例子写为啥一直没效果呢?
function replaceMessage(){
var newnode=document.createElement("i");
var add=document.createTextNode("JavaScript");
newnode.appendChild(add);
var old=document.getElementById("oldnode");
old.parentNode.replaceChild(newnode,old);
}
function replaceMessage(){
var newnode=document.createElement("i");
var add=document.createTextNode("JavaScript");
newnode.appendChild(add);
var old=document.getElementById("oldnode");
old.parentNode.replaceChild(newnode,old);
}
2015-03-11
举报