在表格里点击一下,该格的值就放到同一页面的一个文本框内:
<html>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showinput()
{
elm = event.srcElement;
if (elm.tagName != "TD") return;
document.all.tablecell.value=elm.innerText;
}
//-->
</SCRIPT>
<TABLE border=1 height=100>
<thead id=thead1>
<tr>
<th></th>
<th width=100></th>
<th width=100></th>
<th width=100></th>
</tr>
<TR style="display:none">
<td><input type=checkbox id=checkLine></td>
<TD>000</TD>
<TD>000</TD>
<TD>000</TD>
</TR>
</thead>
<tbody onclick="showinput()" id=tbody1>
<TR>
<td><input type=checkbox id=checkLine></td>
<TD>aaa</TD>
<TD>bbb</TD>
<TD>ccc</TD>
</TR>
<TR>
<td><input type=checkbox id=checkLine></td>
<TD>ddd</TD>
<TD>eee</TD>
<TD>fff</TD>
</TR>
<TR>
<td><input type=checkbox id=checkLine></td>
<TD>ggg</TD>
<TD>hhh</TD>
<TD>iii</TD>
</TR>
</tbody>
<tfoot>
<tr>
<td colspan=4 align=center>
<input type="text" name="tablecell" size="20"></td>
</tr>
</tfoot>
</TABLE></body></html>