第一个table根据checkbox选择tr,在另一个table中显示对应索引的tr(jq遍历的运用)

1 $('#form_1 table tbody').find(':checkbox:checked').each(function(){//查找处于checked状态的checkbox
2   var val = $(this).parent().parent().index();     //找到这个checkbox所在的tr的索引3   $('#form_2 table tbody tr').eq(val).show();   //在form_2中显示对应索引的tr
4 })
原文地址:https://www.cnblogs.com/shichaowen/p/7988095.html