<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DOMinating JavaScript</title>
</head>
<body>
<h1 id="pageTitle">
DOMinating JavaScript
</h1>
<p>
If you need some help with your JavaScript, you might like
to read articles from:
</p>
<ul id="test">
<li><a href="http://www.danwebb.net/" rel="external">Dan Webb</a></li>
<li><a href="http://www.quirksmode.org/" rel="external">PPK</a></li>
<li><a href="http://adactio.com/" rel="external">Jeremy Keith</a></li>
</ul>
<script type="text/javascript" src="example.js"></script>
</body>
</html>

If I try this code the alert I get in the browser is object Text
var test=document.getElementById("test");
var testChild=test.childNodes[0];
alert(testChild);

If I try this code the alert I get in the browser is object HTMLLIELEMENT
var test=document.getElementById("test");
var testChild=test.childNodes[1];
alert(testChild);

If I try this code the alert I get in the browser is object Text
var test=document.getElementById("test");
var testChild=test.childNodes[2];
alert(testChild);

If I try this code I get no alert
var test=document.getElementById("test");
var testChild=test.childNodes[childNodes.length-1];
alert(testChild);

I was expecting all of the alerts to come back with LI but I do not know why that was not the result for all of them.

Help please.

Thank you.

Ronny