<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
<!--
.li01 { background:#FFF; }
.li02 { background:#eeeeee; }
-->
</style>
</HEAD>
<BODY>
<div ><ul id="list01">
<li class="title"><a href="#">title</a></li>
<li><a href="#">111</a></li>
<li><a href="#">222</a></li>
<li><a href="#">333</a></li>
<li><a href="#">444</a></li>
<li><a href="#">555</a></li>
<li><a href="#">666</a></li>
</ul></div>
<script Language="Javascript">
objName=document.getElementById("list01").getElementsByTagName("li")
for (i=0;i<objName.length;i++) {
(i%2==0)?(objName(i).className = "li01"):(objName(i).className = "li02");
}
</script>
</BODY>
</HTML>
posted on 2006-07-22 15:57
汪杰 阅读(460)
评论(1) 编辑 收藏 引用 所属分类:
javascript