Y, por las dudas, la forma de capturar el o los que quieras mediante un índice:
Código PHP:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<!-- hola -->
<script type="text/javascript">
function htmlTree(obj,s){
var r =s || [];
if (obj.hasChildNodes()) {
var child = obj.firstChild;
while (child) {
if (child.nodeType === 8) {
r.push(child.nodeValue );
}
if (child.nodeType === 1) {
r.concat( htmlTree(child,r));
}
child = child.nextSibling;
}
}
return r;
}
onload=function(){alert(htmlTree(document.documentElement.parentNode)[2]);};
</script>
</head>
<body>
<!-- chau -->
</body>
</html>
<!-- uf! -->