<html>
<head >
<title>演示获取Table的值</title>
<script type ="text/javascript" language ="javascript" >
function GetTable23()
{
var txt=document .getElementById ("txtReceiver");
//第一种:用标记id的td元素,获取值方法
txt .value=document .getElementById ("23").innerHTML ;
//第二种:用获取Table(通过其id),指定获取的行、列
var valueTd=document .getElementById ("tbl").rows [1].cells[2];
txt.value=valueTd.innerHTML ;
}
</script>
</head>
<body>
<div>
<table id ="tbl" border="1">
<tr>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
<td id ="23">23</td>
<td>33</td>
</tr>
</table>
<input id="txtReceiver" type="text">
<input id="btnSubmit" type="button" value="获取" onclick ="GetTable23()"; />
</div>
</body>
</html>
转自:怎么用js获取table第1行第2列的值 - JavaScript
http://www.myexception.cn/javascript/901130.html