loop jquery object
<p>I simply try to assign a background color to each div.
it looks simple but it doesn't work.</p>

<pre><code>var divElements = $("div");
var colorArray =["444", "344", "345", "472", "837", "043", "345", "472", "837", "043"];

for (var i=0; i&lt; divElements.length; i++){
divElements[i].css("background","#"+colorArray[i])
}
</code></pre>

<p>I also tried to use jQuery's each</p>

<pre><code>$("div").each(function(i) {
  divElements[i].css("background","#"+colorArray[i])
})
</code></pre>

<p>How do code this in javaScript generic "for loop" and jQuerys .each()</p>
