<script> var m=['2','1'], c=['#f00','#0f0'], i=m.length; while(i--)document.write('<div style="background-color:'+c[i]+'">'+m[i]+'</div>') </script>