JS 复制网页上的表格 扩冲一下,可以复制网页上任何东西

    技术2025-11-14  5

    <INPUT TYPE="button" value="选中测试表格" οnclick="CopyTable()">测试<TABLE border="1" id="oTable"><TR> <TD>测试表s格</TD> <TD>测试表格s</TD></TR><TR> <TD>测试表格</TD> <TD>测试表格</TD></TR></TABLE>文字<SCRIPT LANGUAGE="JavaScript"><!--function CopyTable(){ var txt = document.body.createTextRange(); txt.moveToElementText(oTable); txt.select(); txt.execCommand("Copy");  txt.collapse(false); }--></SCRIPT>

     

    最新回复(0)