title: Problem in using javascript childNodes.length property with elem
body: <p>I have a treeview with drag and drop functionality. Upon completion of drag and drop I need to find the count of the child nodes of the new parent node. So for that I'm using the following 
  lines</p>
  
  <pre><code>var childnodelength=elem.parentNode.parentNode.childNodes.length;
  
  alert(childnodelength);
  </code></pre>
  
  <p>But I always get the same value of 4 irrespective of the no. of childs, with the above alert.
  I've also tried in the following way.</p>
  
  <pre><code>alert(elem.getElementsByTagName("A")[0].childNodes.length);
  </code></pre>
  
  <p>Above line always gives me 1 irrespective of the no. of childs. I am not sure if I am referring correctly in both the ways.</p>
  
  <p>And hence I'm unable to find the no. of child nodes.</p>
  
  <p>Please could someone help me with this?</p>
  
  <p>Thanks</p>