curlen = playlistr.length; for(i = 0; i < curlen; i++) { alert(i); var newel = document.createElement('div'); newel.innerHTML = "
"+(i + 1) + ". "+playlistr[i].showname + " - " + playlistr[i].season + " - " + playlistr[i].moviename + "
"; playel.appendChild(newel); form2.innerHTML = form2.innerHTML + ''; }