我需要在所有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 eachdiv
类时,someClass
将所有p
标签包装起来,但它只是将它们全部包装在 top 中div
。