divのクラスを持つすべての s 内のすべての p タグを見つけて、someClassそれらを別の でラップする必要がありdivます。これは、最初のマークアップがどのように見えるかです:
<div class="someClass">
// Lots of different tags generated by the site
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
</div>
<div class="someClass">
// Lots of different tags generated by the site
<p>Some text</p>
<p>Some text</p>
</div>
次のようになります。
<div class="someClass">
// Lots of different tags generated by the site
<div class="bla">
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
</div>
</div>
<div class="someClass">
// Lots of different tags generated by the site
<div class="bla">
<p>Some text</p>
<p>Some text</p>
</div>
</div>
何か案は?.each(): for eachを使用してみると、すべてのタグdivをラップするクラスがありますが、それらをすべて top でラップするだけです。someClasspdiv