我有两个具有相同类的块,其中内容 - 标题和描述。如何将所有标题收集到一个div中并置于上面的描述中。
我现在拥有什么
<div class="div">
<div class="title"></div>
<p>some text</p>
<div class="title"></div>
<p>some text</p>
<div class="title"></div>
<p>some text</p>
<div class="title"></div>
</div>
<div class="div">
<div class="title"></div>
<p>some text</p>
<div class="title"></div>
<p>some text</p>
<div class="title"></div>
<p>some text</p>
<div class="title"></div>
</div>
想要这个结果-------------------------------------------- ---
<div class="div">
<div class="container-for-title">
<div class="title"></div>
<div class="title"></div>
<div class="title"></div>
<div class="title"></div>
</div>
<p>some text</p>
<p>some text</p>
<p>some text</p>
<p>some text</p>
</div>
<div class="div">
<div class="container-for-title">
<div class="title"></div>
<div class="title"></div>
<div class="title"></div>
<div class="title"></div>
</div>
<p>some text</p>
<p>some text</p>
<p>some text</p>
<p>some text</p>
</div>