title: jQuery assign colors to li list
body: <p>I have 4 items in  and I want to assign 4 different background-color to each of the links, but I don't want the colors to randomize.. lets say if I have this structure</p>
  
  <pre><code>&lt;div id="div_id"&gt;
   &lt;ul&gt;
    &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;More Info&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>how would that be possible?</p>
  
  <p>I have the list of colors. they are (green, blue, red, black)</p>
  
  <p>I tried </p>
  
  <pre><code>$("#div_id ul li").each(function() {
   $(this).css("background","green");
  });
  </code></pre>
  
  <p>To be honest I don't know how would I apply those colors. I can store them in an array but how would I loop and assign the colors?</p>