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>
<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>
<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>
传个id
然后方法中使用document.getElementById(id);
form 里面默认的情况下没有table元素