<style type="text/css" media="screen">
<!-- /* PR-CSS */
table {border-collapse:collapse;border:solid #999;border-width:1px 0 0 1px;}
table td {border:solid #999;border-width:0 1px 1px 0;}
.t1 {background-color:#fff;}/* 第一行的背景色 */
.t2 {background-color:#eee;}/* 第二行的背景色 */
.t3 {background-color:#ccc;}/* 鼠标经过时的背景色 */
-->
</style>
</head>
<body>
<ul><li>11111111</li>
<li>222222222</li>
<li>3333333</li>
<li>444444444</li>
</ul>
<script type="text/javascript">
<!--
var Ptr=document.getElementsByTagName("li");
function $() {
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
}
}
window.onload=$;
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
};
}
//-->
</script>
<!-- /* PR-CSS */
table {border-collapse:collapse;border:solid #999;border-width:1px 0 0 1px;}
table td {border:solid #999;border-width:0 1px 1px 0;}
.t1 {background-color:#fff;}/* 第一行的背景色 */
.t2 {background-color:#eee;}/* 第二行的背景色 */
.t3 {background-color:#ccc;}/* 鼠标经过时的背景色 */
-->
</style>
</head>
<body>
<ul><li>11111111</li>
<li>222222222</li>
<li>3333333</li>
<li>444444444</li>
</ul>
<script type="text/javascript">
<!--
var Ptr=document.getElementsByTagName("li");
function $() {
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
}
}
window.onload=$;
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
};
}
//-->
</script>
<!-- /* PR-CSS */
table {border-collapse:collapse;border:solid #999;border-width:1px 0 0 1px;}
table td {border:solid #999;border-width:0 1px 1px 0;}
.t1 {background-color:#fff;}/* 第一行的背景色 */
.t2 {background-color:#eee;}/* 第二行的背景色 */
.t3 {background-color:#ccc;}/* 鼠标经过时的背景色 */
-->
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
</table>
<script type="text/javascript">
<!--
var Ptr=document.getElementsByTagName("tr");
function $() {
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
}
}
window.onload=$;
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
};
}
//-->
</script>
<!--
function changebg() {
var otable=document.getElementById("mytable");
Ptr = otable.rows
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
}
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
};
}}
window.onload=changebg;//-->
</script>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
<tr><td>asdfasdf</td></tr>
</table>
<script type="text/javascript">
<!--
function changebg() {
var otable=document.getElementById("mytable");
Ptr = otable.rows
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
}
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
};
}}
window.onload=changebg;//-->
</script>