[thelist] strange dom problem

Marcus Andersson marcus at bristav.se
Thu Feb 26 16:47:43 CST 2004


There is nothing strange at all. You add two divs per li.

for (var i=0;i<eachones.length;i++) {

   // you create the first here
   var contentdiv=document.createElement('div');
   contentdiv.innerHTML=eachones[i].innerHTML;

   // and you create another one here
   //(what you do with this one is... nothing?)
   var artdiv=document.createElement('div');

   etc...
}

So there really should be your number of li times two. Remember that 
getElementsByTagName() just doesn't take the immediate children but all 
descendants of the element.

/Marcus



More information about the thelist mailing list