How to alternate style (background color with jquery) for div inside div with id = "container" alternately (even and odd) if I have HTML like this
<div id="container"> <div></div> <div></div> <div></div> <div></div> ... </div>
I know with a table like
#tbl_users tr:nth-child(even) {background: #CCC;} #tbl_users tr:nth-child(odd) {background: #FFF;}
but how does a div apply something like this?
Danka source share