怎样访问table中的某行某列
我想得到table中某行某列的值,但总是得到这样的错误,document.all.tb.rows为空或不是对象。
页面代码:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<table border="1" width="100%">
<tr>
<td width="50%">a</td>
<td width="50%">d</td>
</tr>
<tr>
<td width="50%">b</td>
<td width="50%">c</td>
</tr>
</table>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><input type="reset" value="全部重写" name="B2" onclick = "alert(document.all.tb.rows[1].cells[1].innerText)"></p>
</form>
</body>
</html>