Jquery表格变色 复选框全选,反选

/*jquery静态表格变色*/
$(".tr2").mouseover(function(){
$(this).css("background","#f2c27a");
}).mouseout(function(){
$(this).css("background","#f1f6fc")
});

/*javas动态设置隔行变色*/

var otb=document.getElementById("table1");

for(var i=0;i<otb.rows.length-1;i++)

{

if(i%2)

{otb.rows[i].className="trOdd";}

}

/*jquery动态设置隔行变色*/

$("#table1 tr:nth-child(even)").addClass("trOdd");

/*复选框全选*/
$("#selALL").click(function() {
$("input[type='checkbox'][name='checkbox_inp']").prop('checked',$(this).prop("checked"));
});

$("#unselALL").click(function() {
$this=$(".checkbox1");
$("input[type='checkbox'][name='checkbox_inp']").each(function() {
$(this).prop('checked',!$(this).prop('checked'));
});
});