我希望选择某几行,然后点复制,就能将选中的这些姓名全部复制到剪贴板。注意我要求的是:我粘贴的时候,这些姓名要是一行一个被粘贴。
如果做不到,那就简单一点:选中后点下一步,选中的这些姓名被传到一个新的页面并按每行一个显示出来。
请教老师高手能实现吗。谢谢。
<table>
<thead>
<th><input type="checkbox"> 全选</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr class="tr1">
<td><input type="checkbox"></td>
<td>张三</td>
<td>女</td>
<td>88</td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td>李四</td>
<td>男</td>
<td>18</td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td>王五</td>
<td>女</td>
<td>12</td>
</tr>
</tbody>
</table>
可以用 url 查询参数传值,缺点是会发送给服务器,容量小
demo.html
next.html
更推荐用
sessionStorage
,存到本地,切换页面再读取,不会发送给服务器,容量大类似的还有
localStorage
,区别是localStorage
是持久存储,sessionStorage
关闭页面会自动清除数据demo.html
next.html