html - jQuery every other background grey -


ok have html , trying style every other line of cart goes white grey. know easier css3 since needs support ie7 think jquery might better route.

        <div id="checkouttable">         <div id="checkoutrow" class="bold headline">             <div id="checkoutcell" class="headline">item <br>number</div>             <div id="checkoutcell" class="headline itemname">item <br>name</div>             <div id="checkoutcell" class="headline">quantity <br>per unit</div>             <div id="checkoutcell" class="headline">units free <br>remaining</div>             <div id="checkoutcell" class="headline">units <br>ordered</div>             <div id="checkoutcell" class="headline">cost per unit <br>(usd)</div>             <div id="checkoutcell" class="headline">total cost <br>(usd)</div>         </div>         <div id="checkoutrow" class="center cartcheckout">             <div id="checkoutcell" class="first">flt199</div>             <div id="checkoutcell" class="first itemname">vehicle flyer</div>             <div id="checkoutcell" class="first">1</div>             <div id="checkoutcell" class="first">20</div>             <div id="checkoutcell" class="first"><input name="unitsordered" id="" size="5"></div>             <div id="checkoutcell" class="first">$10.00</div>             <div id="checkoutcell" class="first">$0.00</div>         </div>         <div id="checkoutrow" class="center cartcheckout">             <div id="checkoutcell" class="first">flt199</div>             <div id="checkoutcell" class="first itemname">vehicle flyer</div>             <div id="checkoutcell" class="first">1</div>             <div id="checkoutcell" class="first">20</div>             <div id="checkoutcell" class="first"><input name="unitsordered" id="" size="5"></div>             <div id="checkoutcell" class="first">$10.00</div>             <div id="checkoutcell" class="first">$0.00</div>         </div>     </div> 

then thought jquery trick isn't working.

  $(function() {     $(".cartcheckout:even").css("background", "#ccc;");   }); 

you have ; in color #ccc; not valid. if change #ccc work shown in demo.

$(function() {     $(".cartcheckout:even").css("background", "#ccc");   }); 

see fiddle demo


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -