Stripe class for div
问题 I have a long list of multiple div... let's say 20 div All wrap in another one.. <div id="main"> <div class="xyz"> text text </div> <div class="xyz"> text text </div> <div class="xyz"> text text </div> <div class="xyz"> text text </div> <div class="xyz"> text text </div> .... etc </div> i like to add class "grey" in one out of two div and make it zebra ! jquery please ! 回答1: $('.xyz:odd').addClass('grey'); Do mind that 'grey' is not a semantic classname. Better call id 'odd' or 'zebra' or