歡迎來到 DOM 世界! ;
if (node.nodeName != null) {
temp += "nodeName:" + node.nodeName + "\n) temp += "節點名:null!\n"; //
,\n
}
if (node.nodeType != null) {
temp += "nodeType:" + node.nodeType + "\n";
}
else {
temp += "nodeType:null!\n";
}
else {
}
var currentElement = document.getElementById('p1');
//alert(msg);# frent .firstChild;
msg += nodeStatus(firstChild);
//父親的下一個兒子->弟弟
var youngBrother = firstChild.nextSibling;
;
//2弟的兒子=p父親的大孫子
var grandSon = youngBrother.firstChild;
#//孫子的父親
var grandSonParent = grandSon.parentNode;
msg += nodeStatus(grandSonParent);
var grandSononParentElderBrandw. nodeStatus(grandSonParentElderBrother);
//大哥的父親
msg += nodeStatus(parent);
##1父親的兒子女兒子
msg += nodeStatus(lastChild);
//父親的所有兒子
var childl = ;
for (var i = 0;我< allChild.length; i++) {
allChildInfo += nodeStatus(allChild[i]);
}
//alert(msg);