function clearText() { var content=document.getElementById("content"); var x; for (x in content.childNodes) { var childNode = content.childNodes[i]; content.removeChild(childNode); } } function clearText() { var content=document.getElementById("content"); for(var i=content.childNodes.length-1;i>=0;i--) { var childNode = content.childNodes[i]; content.removeChild(childNode); } }
这2个函数为什么第一个就不行?
stone310
chwech
相关分类