Home > Web Front-end > JS Tutorial > JavaScript interlaced color changing function code_Basic knowledge

JavaScript interlaced color changing function code_Basic knowledge

WBOY
Release: 2016-05-16 18:17:51
Original
948 people have browsed it

First define two styles about the background color
tag is the id object
c1 is style 1
c2 is style 2

Copy code The code is as follows:

<script> <br>function changeRowsBg(tag,c1,c2) ​​{ <br> var i = 0; <br> var obj_tag = document .getElementsByTagName(tag); .className = c2; <br>  } <br>} <br></script>

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