javascript - Push attributes to array by className? -
can please me how push different attributes of elements same classname array? i'm not @ javascript , have tried arrays turns empty.
one array should contain url of images , other 1 image-texts in span-element:
function slideshow(){ imgurllist.length = 0; imgtextlist.length = 0; var imgurl = document.getelementsbyclassname('markedimg'); var imgtext = document.getelementsbyclassname('marked'); for(j=0; j<imgurl.length; j++){ imgurllist.push(imgurl.src); } for(k=0; k<imgtext.length; k++){ imgtextlist.push(imgtext.innerhtml); } openwindow(); }