有没有一种简单的方法将元素移动到其父元素内部?
就像这样...
从:
<div class="test">hello 1</div>
<div class="test">hello 2</div>
<div class="test">hello 3</div>
to:
<div class="test">hello 1</div>
<div class="test">hello 3</div>
<div class="test">hello 2</div>
要么将一个div向上或向下移动一步,要么使用索引在特定位置进行appendTo。