我有多个部分...在这些部分中几乎没有子元素...我需要进行操作,以便为每个部分移动 1 个元素,例如 .inner 在另一个元素之后,例如 h1
我的尝试在这里http://jsfiddle.net/shavindra/LDpwq/1/但问题是它没有循环并在最后打印好..但我希望输出不同,如下所示......
初始状态:
<section class="greeting">
<h2>Greetings 1</h2>
<div class="time">Morning</div>
<div class="inner">Good 1</div>
</section>
<br />
<br />
<section class="greeting">
<h2>Greetings 1</h2>
<div class="time">Afternoon</div>
<div class="inner">Good 2</div>
</section>
<br />
<br />
<section class="greeting">
<h2>Greetings 1</h2>
<div class="time">night</div>
<div class="inner">Good 3</div>
</section>
操纵后
<section class="greeting">
<h2>Greetings 1</h2>
<div class="inner">Good 1</div>
<div class="time">Morning</div>
</section>
<br />
<br />
<section class="greeting">
<h2>Greetings 1</h2>
<div class="inner">Good 2</div>
<div class="time">Afternoon</div>
</section>
<br />
<br />
<section class="greeting">
<h2>Greetings 1</h2>
<div class="inner">Good 3</div>
<div class="time">night</div>
</section>