var oldColor='';
//var oTab=document.getElementById('tab1')
function toColor(tableID)
{
var oTab=document.getElementById(tableID)
for(var i=0;i<oTab.tBodies[0].rows.length;i++)
//隔行变色
{
oTab.tBodies[0].rows[i].onmouseover=function()
{ //鼠标移入变色
oldColor=this.style.background;
this.style.background='#dff0d8';
};
oTab.tBodies[0].rows[i].onmouseout=function()
{ //鼠标移出恢复原来颜色
this.style.background=oldColor;
}
}
}
toColor(tableId);