以onMouseOver为例
function add() { tr=Grid1.insertRow(); td=tr.insertCell(); td.innerText="a"; td=tr.insertCell(); td.innerText="b"; tr.attachEvent('onmouseover',c1); tr.attachEvent('onmouseout',c2); //document.all.Grid1.rows[0].οnmοuseοver=c(); } function c1() { var t=event.srcElement.parentElement; t.style.backgroundColor="#dedede"; } function c2() { var t=event.srcElement.parentElement; t.style.backgroundColor=""; }