var arr = ["1","2","3"]; for(var i in arr) document.write('<img alt="" src="image'+arr[i]+'.gif"><br>');