添加删除div之类的
1 var my = document.getElementById("myDiv"); 2 var myParent = my.parentNode; 3 if(my != null) 4 { 5 my.parentNode.removeChild(my); 6 } 7 var myNew = document.createElement("myDiv"); 8 myNew.id = "scorePanel"; 9 myParent.appendChild(myNew);
时间: 2024-11-07 04:36:14