亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

原生javascript實現(xiàn)隔行換色

 更新時間:2015年01月04日 10:11:18   投稿:hebedich  
這篇文章主要介紹了原生javascript實現(xiàn)隔行換色,需要的朋友可以參考下

js讓我們一起從基礎(chǔ)來學習,我們一點一點的來學習

下邊是我寫的代碼,然后大家看著學習下吧?。?!

復制代碼 代碼如下:

<html>
<head>
<title>js演示</title>
</head>
<body>
<script>
document.write('<table border="1" width="100px" align="center">');
var i=0;
while(i<100){
if(i%10==0){
if(i%20==0)
bg="#cccccc";
else
bg="#ffffff";
document.write('<tr onmouseover="show(this)" onmouseout="onshow(this)" bgcolor="'+bg+'">');
}
document.write('<td>'+i+'</td>');
i++;
if(i%10==0){
document.write("<tr>");
}
}
document.write("</table>")
var ys=null;
function show(obj){
ys=obj.bgColor;
obj.bgColor="red";
}
function onshow(obj){
obj.bgColor=ys;
}
</script>
</body>
</html>

功能很簡單,卻非常實用,小伙伴們參考下吧。

相關(guān)文章

最新評論