将一个表的值复制到另一个表(如何将此js函数转换为jQuery)

我在这里遇到一个小问题..我想要做的是将id的描述从一个表复制到另一个表。 我写了一半的javascript,任何人都可以告诉我如何在jquery中转换这个函数。 我希望根据id从第一个表复制到第二个表的描述。 在jquery中使用’contains’,( 比较2个表列值并将下一列内容复制到第二个表 )完成此操作,因为有1000个表行,资源管理器崩溃了。 有没有办法简化它?…代码如下……

当我点击第二个表中的测试时,当前的javascript工作,但我想在页面加载时将值附加到第二个表…请帮助

psx-pdu120v1some description1
psx-pdu120v1some description1
psx-pdu120v3some description3
psx-pdu120v4some description4
psx-pdu120v5some description5
psx-pdu120v6some description6
psx-pdu120v7some description7
psx-pdu120v8some description8
psx-pdu120v9some description9
psx-pdu120v1test
psx-pdu120v3test
psx-pdu120v4test
psx-pdu120v5
psx-pdu120v6
psx-pdu120v7
psx-pdu120v8
psx-pdu120v9

 $(document).ready(function() { $('.whipItem', '.data').each(function(index, element) { //for each whipItem in the data table var name = $(element).text(); //get the text value var desc = $(".itemname[id='" + name + "']").text(); //get the description whose id matches the name in the report table. $(element).next().text(desc); //change the value of the next td to the description. }); }); 
 $(function() { $.each($('firstTable td'), function(i) { var tableData = $(this); $('.secondTable td').eq(i).text(tableData.text()); }); });