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个函数为什么第一个就不行?
添加回答
举报
0/150
提交
取消