在JQuery中交换行 [英] Swapping rows in JQuery
本文介绍了在JQuery中交换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有一个如下所示的表,并且有一个向上和向下的箭头可以上下移动行,那么在JQuery中如何交换行呢?
If I have a table as shown below, and have a up and down arrow that moves rows up and down, how would I go about swapping rows in JQuery?
<tr id="Row1">
<td>Some label</td>
<td>Some complex control</td>
</tr>
<tr id="Row2">
<td>Some label</td>
<td>Some complex control</td>
</tr>
<tr id="Row3">
<td>Some label</td>
<td>Some complex control</td>
</tr>
推荐答案
$("#Row1").after($("#Row2"));
将起作用
这篇关于在JQuery中交换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文