两个table之间相互移动数据

时间:2024-04-10 13:50:56 

<script language=javascript> function moveIt(obj){ var tableId; if(obj.parentNode.parentNode.id == "t1"){ tableId = document.getElementById("t2"); }else{ tableId = document.getElementById("t1"); } var newRow = tableId.insertRow(0); newRow.insertCell(0).innerHTML = obj.cells(0).innerHTML; newRow.insertCell(1).innerHTML = obj.cells(1).innerHTML; obj.removeNode(true); } </script> <table id=t1 border=1> <tr>  <td><input type=checkbox onclick="this.checked=false;{moveIt(this.parentNode.parentNode);}"></td> <td>1</td> </tr> <tr> <td><input type=checkbox onclick="this.checked=false;{moveIt(this.parentNode.parentNode);}"></td> <td>2</td> </tr> </table><hr> <table id=t2 border=1> <tr> <td><input type=checkbox onclick="this.checked=false;{moveIt(this.parentNode.parentNode);}"></td> <td>3</td> </tr> <tr> <td><input type=checkbox onclick="this.checked=false;{moveIt(this.parentNode.parentNode);}"></td> <td>4</td> </tr> </table>


标签:table,移动数据
0
投稿

猜你喜欢

  • jquery+ashx无刷新GridView数据显示插件(实现分页、排序、过滤功能)

    2024-05-11 09:17:35
  • MySQL中随机生成固定长度字符串的方法

    2010-12-08 16:25:00
  • 关于捕获用户何时点击window.onbeforeunload的取消事件

    2024-04-22 22:45:07
  • PHP实现图片上传并压缩

    2024-05-22 10:06:09
  • MySQL 客户端不输入用户名和密码直接连接数据库的2个方法

    2024-01-14 05:30:41
  • 一篇文章带你深入了解Mysql触发器

    2024-01-14 15:42:35
  • 为FCKeditor2.6添加行距功能(最新修改)

    2008-08-18 21:09:00
  • python中类的属性和方法介绍

    2023-10-22 05:14:47
  • 在go语言中安装与使用protobuf的方法详解

    2024-04-25 15:27:32
  • MySQL查询冗余索引和未使用过的索引操作

    2024-01-22 22:04:23
  • python类参数定义及数据扩展方式unsqueeze/expand

    2023-08-07 21:56:42
  • Python中eval函数的表达式作用示例

    2022-06-14 02:18:32
  • pytorch-神经网络拟合曲线实例

    2022-03-17 18:17:30
  • Python Flask搭建yolov3目标检测系统详解流程

    2023-07-07 12:40:05
  • js+css实现换肤效果

    2024-04-17 09:53:54
  • PHP mysqli扩展库 预处理技术的使用分析

    2023-11-21 07:10:21
  • 编写一个javascript元循环求值器的方法

    2024-04-23 09:28:15
  • 给Python入门者的一些编程建议

    2023-09-24 03:22:13
  • 解析mysql与Oracle update的区别

    2024-01-25 01:35:55
  • Python实现为PDF大文件批量去除水印

    2023-04-14 19:59:04
  • asp之家 网络编程 m.aspxhome.com