Home >Web Front-end >JS Tutorial >jQuery table alternate row color change code [revised annotated version]_jquery

jQuery table alternate row color change code [revised annotated version]_jquery

WBOY
WBOYOriginal
2016-05-16 18:58:451097browse

Copy code The code is as follows:

.org/1999/xhtml">


< title>jquery odd and even color change

< ;script>
$(document).ready(function() {
$('tr').addClass('odd');
$('tr:even').addClass('even '); //Odd and even color change, add style
});










🎜>




< ;tr>






🎜>


;

As You Like It
All's Well that Ends Well
Hamlet Tragedy
Macbeth Tragedy
Romeo and Juliet Tragedy
History
Henry V





The following is a js version, required Friends can refer to it.






Statement:
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