У меня есть следующий html...
<body>
<section>
<div class="clip">
<header>first section header</header>
<aside>first section aside</aside>
</div>
<article>
<div class="content">
</div>
</article>
<article>
<div class="content">
</div>
</article>
</section>
<section>
<div class="clip">
<header>second section header</header>
<aside>second section aside</aside>
</div>
<article>
<div class="content">
</div>
</article>
<article>
<div class="content">
</div>
</article>
</section>
</body>
Используя jQuery, я хочу добавить все элементы div .content с содержимым их разделов-потомков .clip div.
образуя это...
<body>
<section>
<div class="clip">
<header>first section header</header>
<aside>first section aside</aside>
</div>
<article>
<div class="content">
<header>first section header</header>
<aside>first section aside</aside>
</div>
</article>
<article>
<div class="content">
<header>first section header</header>
<aside>first section aside</aside>
</div>
</article>
</section>
<section>
<div class="clip">
<header>second section header</header>
<aside>second section aside</aside>
</div>
<article>
<div class="content">
<header>second section header</header>
<aside>second section aside</aside>
</div>
</article>
<article>
<div class="content">
<header>second section header</header>
<aside>second section aside</aside>
</div>
</article>
</section>
</body>
в настоящее время у меня есть это для jquery
$(document).ready(function () {
$(".content").prepend($(".content").parentsUntil("section").siblings("div").html());
});
который выбирает только документы первого содержимого .clip div. Как мне сформировать строку selector/jquery, чтобы использовать правильные элементы div .clip для каждого элемента div .content?