请问 为什么行不通
斜体不能改为粗体
2016-11-12
function replaceMessage(){
var myb=document.getElementById("oldnode");
var myi=document.createElement("i");
myi.id = "oldnode";
myb.parentNode.replaceChild(myi,myb);
myi.innerHTML=myb.innerHTML;
}
function replaceMessage1(){
var myi=document.getElementById("oldnode");
var myb=document.createElement("b");
myb.id = "oldnode";
myi.parentNode.replaceChild(myb,myi);
myb.innerHTML=myi.innerHTML;
}
function replaceMessage(){
var myb=document.getElementById("oldnode");
var myi=document.createElement("i");
myi.innerHTML=myb.innerHTML;
myb.parentNode.replaceChild(myi,myb);
}
function replaceMessage1(){
var myi=document.getElementsByTagName("i")[0];
var myb=document.createElement("b");
myb.innerHTML=myi.innerHTML;
myi.parentNode.replaceChild(myb,myi);
}
举报