javascript - Looping Through className index not working...Alternatives? -


wins.push(document.getelementsbyclassname("page")[x].attributes["id"].value); 

this code for() loop in javascript, using variable 'x'. unlike google chrome, firefox , opera don't seem comprehending fact variable index of class wish attribute "id" from.

is there alternative method?

i think should work out

function findpageclasses()    {      var pageclasses= document.getelementsbyclassname("page");      for(var i=0; i<pageclasses.length; i++)         {           wins.push(pageclasses[i].attributes["id"].value);         }     } 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -