<table id="tab">
<tr><td>123</td></tr>
</table><script>
var tab=document.getElementById("tab");
AddTableEvent(tab,show);function show(){
    alert("hello table!");
}
function AddTableEvent(table,fun){
    table.rows[0].onmouseover=fun;
}
</script>

解决方案 »

  1.   

    function AddRows(){
    tb = document.all.DetailTable;
    if ( tb.style.display =="none"){
    tb.style.display ="";
    }
    index = tb.rows.length;
    var row =tb.insertRow();
    row.id = "tr"+index;
    var cell2 = row.insertCell();
    var cell3 = row.insertCell();
    var cell4 = row.insertCell(); cell2.innerHTML="<input type=text name=mname size=10 id=mname onmouseover='open()'>";
    cell3.innerHTML="<input type=text name=num size=10 id=num>";
    cell4.innerHTML="<input type=text name= size=10 id=>";
    }