第1行 | 第1行 |
第2行 | 第2行 |
第3行 | 第3行 |
第4行 | 第4行 |
第5行 | 第5行 |
第6行 | 第6行 |
用jquery的方法
$("#tb tbody tr").toggle(
function(){
$(this).css("background-color","#CCC");
},function(){
$(this).css("background-color","#00F");
});
var index = 1;
function click()
{
if(index == 1)
{
$("tr:even").css("background-color","#CCC");
$("tr:odd").css("background-color","#00F");
index = 0;
}
else if(index == 0)
{
$("tr:even").css("background-color","#FFF");
$("tr:odd").css("background-color","#C00");
index = 1;
}
}