日期:2014-05-16  浏览次数:20503 次

js 设置隔行显示颜色

???? <script>
var tbl = document.getElementById("td1");
for(var i=0;i<tbl.rows.length;i++){
? if(i%2 == 0) tbl.rows[i].style.backgroundColor = "#FFF";
? else tbl.rows[i].style.backgroundColor = "#FF0000";
}
</script>