节点值的问题
var a = document.getElementsByTagName("div")[0].childNodes; for(var i = 0; i < a.length ; i++){ document.write("第" + i + "个子节点名是:"+ a[i].nodeName + "<br>"); document.write("第" + i + "个子节点值是:"+ a[i].nodeValue + "<br>"); document.write("第" + i + "个子节点类型是:"+ a[i].nodeType + "<br>"); }