Select all children and assign random background colors
<p>I am trying to select child nodes and randomly change each divs background colour so I can quickly see how the page is broken up.
I found a nice little script to produce the hex but am struggling to apply that to selected divs .  </p>

<p>This returns the hex values:</p>

<pre><code>function random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i &lt; 6; i++ ) {
    color += letters[Math.round(Math.random() * 15)];
}
return color;
};
</code></pre>

<p>And this is not looping through the children and assigning random values.</p>

<pre><code>function loop(){
children = $("#container").children();
$(children).each(function(){
    $(this).css("background-color", random_color());
   }    
};

loop();
</code></pre>

<p>Just thought I would throw this one out there.</p>

<p>Thank you in advance.</p>
