function replaceNodeText(id,newText){
var node = document.getElementById(id);
while(node.firstChild)
node.removeChild(node.firstChild);
node.appendChild(document.creatTextNode(newText));
}
时间: 2024-12-22 23:20:35
function replaceNodeText(id,newText){
var node = document.getElementById(id);
while(node.firstChild)
node.removeChild(node.firstChild);
node.appendChild(document.creatTextNode(newText));
}