<script type="text/javascript"> 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); } } </script>
采用逆序来删除
<script type="text/javascript"> 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); } } </script>
采用逆序来删除