For example we 5 DIVs:
<div id="container" >
<div class="child">1</div>
<div class="child">2</div>
<div class="child">3</div>
<div class="child">4</div>
<div class="child">5</div>
</div>
How can I change the background color of even DIVs?
If you wanted a javascript option for some reason (maybe you’re looking to do more than just a class?) you could use the each() function in jquery. Here is a functioning example to boot!
CSS
Javascript