[javascript]代码库
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href=""/>
<script src="js/jquery.js" type="text/javascript"></script>
<style>
li{list-style: none;}
</style>
<script type="text/javascript">
function li(){
var a=document.getElementById('lis');
var b=a.children;
for(var i=0;i<b.length;i++){
if(i%2){
b[i].style.background='blue';
}else{
b[i].style.background='red';
}
}
}
var a=document.getElementById('lis');
</script>
</head>
<body onload="li();">
<ul id="lis">
<li>first</li>
<li>second</li>
<li>third</li>
<li>fdsa</li>
<li>first</li>
<li>second</li>
<li>third</li>
<li>fdsa</li>
</ul>
</body>
</html>