如何使用 jQuery 找到字符串并将其包装到 span 中?例如,
<p>
<span class="span1">afijaifjiaj</span>
ajfijaogoag
<span class="span1">afijaifjiaj</span>
aokaodgg
<span class="span1">afijaifjiaj</span>
</p>
我想把它做成:
<p>
<span class="span1">afijaifjiaj</span>
<span class="span2">ajfijaogoag</span>
<span class="span1">afijaifjiaj</span>
<span class="span2">aokaodgg</span>
<span class="span1">afijaifjiaj</span>
</p>