0

假设我的表中有 3 行,如下所示:

$("tr").filter(function(){ return $(this).text() == '1'; }).text('One');
$("tr").filter(function(){ return $(this).text() == '2'; }).text('Two');
$("tr").filter(function(){ return $(this).text() == '3'; }).text('Three');

如何重新排列行以使第 3 行位于第 1 行?

4

1 回答 1

0
one = $("tr").filter(function(){ return $(this).text() == '1'; }).text('One');
two = $("tr").filter(function(){ return $(this).text() == '2'; }).text('Two');
three = $("tr").filter(function(){ return $(this).text() == '3'; }).text('Three');
one.before(three);
于 2013-06-05T17:42:33.850 回答