javascript -- html collection has a .length but undefined .item(*)
<p>I have a function that calls to an xml page, picks out elements by the tag names, and I'm trying to call back a specific one.  code so far is:</p>

<pre><code>var xmlDoc = loadXMLDoc("test.xml");
var x = xmlDoc.getElementsByTagName("tagname");
var PittWins = x.item(2); 
</code></pre>

<p>This will come back [object element]</p>

<pre><code>var xmlDoc = loadXMLDoc("test.xml");
 var x = xmlDoc.getElementsByTagName("tagname");
var PittWins = x[2].data; 
</code></pre>

<p>The above code gives me undefined.</p>

<pre><code>var xmlDoc = loadXMLDoc("nhl.xml");
var x = xmlDoc.getElementsByTagName("tagname");
var PittWins = x.length;
</code></pre>

<p>when entered above, i get a result which is correct.  </p>

<p>I am trying to understand why it's giving me a length and not a specific node..</p>
