还是不明白为什么要加parentNode?
function replaceMessage(){
var t1 = document.getElementById('oldnode')
var t2=document.createElement('i')
t2.innerHTML="js+css"
t1.parentNode.replaceChild(t2,t1)
}
function replaceMessage(){
var t1 = document.getElementById('oldnode')
var t2=document.createElement('i')
t2.innerHTML="js+css"
t1.parentNode.replaceChild(t2,t1)
}
2018-11-06
举报