Home  >  Article  >  Web Front-end  >  JS 实现双色表格实现代码_javascript技巧

JS 实现双色表格实现代码_javascript技巧

WBOY
WBOYOriginal
2016-05-16 18:41:111145browse
clip_image001原理其实很简单:利用getElementsByTagName得到所有的元素,然后分别为奇数项和偶数项的 元素添加背景颜色。
核心代码:
复制代码 代码如下:



全部代码:
复制代码 代码如下:



双色表格































姓名 科目 成绩
张三 语文 90
张三 数学 87
李四 数学 68
王五 英语 76




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