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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -