jquery 实现两个表格之间的数据互换
jquery 实现两个表格之间的数据互换?
[解决办法]
能说的详细点吗?比如是2个格式完全相同的表数据互换,还是什么?
[解决办法]
是表格中全换还是换一列还是一行还是什么?楼主的意思太模糊了
[解决办法]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">table { border:1px solid #000;}</style><script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script><script type="text/javascript">$(document).ready( function() { $("#btn_switchTableData").click( function() { var t1 = $("#t1").children().clone(); $("#t1").empty().append($("#t2").children()); $("#t2").append(t1); });});</script></head><body><table id="t1"> <tr> <td>AAA</td> </tr></table><table id="t2"> <tr> <td>BBB</td> </tr></table><input type="button" value="互换" id="btn_switchTableData" /></body></html>