Home > Web Front-end > JS Tutorial > jQuery alternate display of row background color (alternate row color) implementation code_jquery

jQuery alternate display of row background color (alternate row color) implementation code_jquery

WBOY
Release: 2016-05-16 18:39:33
Original
1301 people have browsed it

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");


  • Odd

  • Even number

  • Even number


odd: Single
even: Double
jQuery table changes color every other row Code

li improved version of alternate row color change

JS control table alternate row color change
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template