Prova cosi:
for ( var i = 0; i <= document.list.id.length; i++)
aggiungendo = al for.