Home > Article > Web Front-end > jQuery alternate display of row background color (alternate row color) implementation code_jquery
Some css definitions can be chosen according to your needs.
//Display single and double lines with different background colors [Method 1]:
// $("#UL_id li:even").attr("className","redClass");
// Display odd and double rows with different background colors [Method 2]:
$("#UL_id li:even").addClass("redClass");