<INPUT TYPE="button" value="选中测试表格" οnclick="CopyTable()">
测试
<TABLE border="1" id="oTable">
<TR>
<TD>测试表格</TD>
<TD>测试表格</TD>
</TR>
<TR>
<TD>测试表格</TD>
<TD>测试表格</TD>
</TR>
</TABLE>文字
<SCRIPT LANGUAGE="JavaScript">
<!--
function CopyTable()
{
var txt = document.body.createTextRange();
txt.moveToElementText(oTable);
txt.select();
}
//-->
</SCRIPT>
转载于:https://www.cnblogs.com/zhangpengshou/archive/2007/08/19/861554.html