<html>
<body>
<span id="sp"></span>
<script>
document.getElementById("sp").childNodes[0].nodeValue='12345';
</script>
</body>
</html>
<body>
<span id="sp"></span>
<script>
document.getElementById("sp").childNodes[0].nodeValue='12345';
</script>
</body>
</html>
document.getElementById("sp")没有子节点
alert(document.getElementById("sp").childNodes.length==0); //true
源文件:file:///F:/Tuwi/JavaScript/Test/test.htm
行:15