I have an ajax that shows the results to me in a JSON, I need the colors of <div>
to alternate: in the first gray color, the second white, the third gray, the fourth white, and so on. How do I do that? I can put class 1 in the even div and class 2 in the odd div, I just need to know how to do it.
Follow my example code in html:
<div class="historico_registroA">
<span class="historico_registro_data">12/10/2016 às 11:00</span>
</div>
<div class="historico_registroB">
<span class="historico_registro_data">22/11/2016 às 15:30</span>
</div>
<div class="historico_registroA">
<span class="historico_registro_data">07/12/2016 às 18:00</span>
</div>
<div class="historico_registroB">
<span class="historico_registro_data">09/12/2016 às 15:00</span>
</div>