我的下面的表格包含表格
<form name="editor">
<table>
<tr>
<td>
<select>
<option value="37">A</option>
<option value="38">B</option>
<option value="39">C</option>
<option value="40">D</option>
</select>
</td>
<td>
<select>
<option value="37">A</option>
<option value="38">B</option>
<option value="39">C</option>
<option value="40">D</option>
</select>
</td>
</tr>
<td>
<select>
---
---
</select>
</td>
</tr>
</table>
<INPUT Type=Button Value="Play" onClick='playt()'>
</form>`
我将在表格中包含动态行。 我想将整个表传递给JavaScript函数&amp;想要在数组变量中访问JavaScript函数中的单元格值。
function playt()
{
var i = document.getElementsByTagName('td').length;
var composition = document.getElementsByTagName('td');
document.getElementById("demo").innerHTML = "Found " + composition[0] + " elements in the form.";
}
</script>
&#13;