2
I have an ajax that shows the results to me in a JSON, I need the colors of the <div>
alternem: in the first gray color, in the second white, in the third gray, in the fourth white and so on. How do I do this? I can put class 1 in the even div and class 2 in the odd div, I just need to know how to do.
Follow my code with html example:
<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>
http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_dom_addclass
– Reginaldo Rigo