2个alert都显示undifined...为什么啊?
<form method="post" name="myform" id="myform">
<table width=100% height="300" cellspacing=0 border=1 frame=box rules=rows name="list" id="list" >
<tr height=40 ondblclick="movetable(document.myform.list,'name');">
<td>HT-912</td>
<td>100</td>
</tr>     
</table>
</form>
<script language="JavaScript">function movetable(t,name)
{
alert(t);
alert(document.myform.list);}
</script>

解决方案 »

  1.   

    飘过~很明显 document.myform.list 不存在,并且很明显 t=document.myform.list
      

  2.   

    document.getElementById("list");//你那种写法貌似只能用在表单元素上面
      

  3.   

    <form method="post" name="myform" id="myform">
    <table width=100% height="300" cellspacing=0 border=1 frame=box rules=rows name="list" id="list" >
    <tr height=40 ondblclick="movetable(document.myform.list[0],'name');">
    <td>HT-912 </td>
    <td>100 </td>
    </tr>   
    </table>
    </form>
    <script language="JavaScript">function movetable(t,name)
    {
    alert(t);
    alert(document.myform.list[0]);}
    </script>
      

  4.   

    最好的方式就是用id去取document.getElementById("list");
      

  5.   

    没有这么用的
    传个id
    然后方法中使用document.getElementById(id);
      

  6.   

    使用document.getElementById(id);吧
    form 里面默认的情况下没有table元素