0
我想从A标签选择与jquery br标签并包装它。使用jquery包装多个选定的元素与div divc与
我是第三方开发者开发的Chrome扩展程序,我得到这个数据的工作与:
<div id="indiv" style="font-size: 12px">
<a href="/?side=profiles&id=60438"><span style="color: #2498E0">Esmeralda Angelseye</span></a> (21:12): content here
<br>
<a href="/?side=profiles&id=39818"><span style="color: #800909">Ernest Ferdinand Solis</span></a> (21:09): content here
<br>
<a href="/?side=profiles&id=60438"><span style="color: #2498E0">Esmeralda Angelseye</span></a> (21:12): content here
<br>
<a href="/?side=profiles&id=39818"><span style="color: #800909">Ernest Ferdinand Solis</span></a> (21:09): content here
<br>
</div>
正如你看到的,每一个“后”是单独用在第一和BR末。
我已经将我应该如何平衡的办法,我测试过一些野生的东西一样,没有线索:
$("<div>").insertBefore("#indiv a");
$("</div>").insertAfter($("#indiv a").next().next());
jQuery的追加/ DIV之后自动股利..
如何我想它看起来像到底:
<div id="indiv" style="font-size: 12px">
<div>
<a href="/?side=profiles&id=60438"><span style="color: #2498E0">Esmeralda Angelseye</span></a> (21:12): content here
<br>
</div>
<div>
<a href="/?side=profiles&id=60438"><span style="color: #2498E0">Esmeralda Angelseye</span></a> (21:12): content here
<br>
</div>
<div>
<a href="/?side=profiles&id=60438"><span style="color: #2498E0">Esmeralda Angelseye</span></a> (21:12): content here
<br>
</div>
<div>
<a href="/?side=profiles&id=60438"><span style="color: #2498E0">Esmeralda Angelseye</span></a> (21:12): content here
<br>
</div>
</div>
有希望吗?
是的,好的想法!它几乎可以选择所有内容,但是“可以在这里找到”的部分确实没有标签。 –
可以添加标签吗? – NemanjaD