for(var x=0; x < boxesEL.length; x++) // comparison should be "<" not "<=" { boxesEL[x].value = "some value"; }