Home > Web Front-end > JS Tutorial > Native javascript implements interlaced color change_javascript skills

Native javascript implements interlaced color change_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:22:28
Original
1059 people have browsed it

JS let us learn from the basics together, let’s learn bit by bit

The following is the code I wrote, and everyone can watch and learn from it! ! !

Copy code The code is as follows:



js demo


<script><br> document.write('<table border="1" width="100px" align="center">');<br> var i=0;<br> while(i<100){<br /> if(i ==0){<br /> if(i ==0)<br /> bg="#cccccc";<br /> else<br /> bg="#ffffff";<br /> document.write('<tr onmouseover="show(this)" onmouseout="onshow(this)" bgcolor="' bg '">');<br> }<br> document.write('<td>' i '</td>');<br> i ;<br> if(i ==0){<br> document.write("<tr>");<br> }<br> }<br> document.write("</table>")<br> var ys=null;<br> function show(obj){<br> ys=obj.bgColor;<br> obj.bgColor="red";<br> }<br> function onshow(obj){<br> obj.bgColor=ys;<br> }<br> </script>


The function is very simple, but very practical. Friends, please refer to it.

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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template