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
Post a Comment