<div id="els">
<ul>
<li><div>My example text<a href="javascript:void(0);">Actor</a>
<a href="/groups/viewgroup/13-first-group">Group one</a></div></li>
<li><div>My example text 2 <span>posted by Andrew</span></div></li>
<li><div>My example text 3</li>
<li><div>
<a href="javascript:void(0);">Actor</a>
<a href="/groups/viewgroup/1-first-group">Group one</a>
</div>
</li>
<li><div><a href="javascript:void(0);">Actor</a>
<a href="/groups/viewgroup/10-ten-group">Ten group</a>My example text. </div></li>
<li>
<div>6 element. <a href="/j1.5/index.php/jomsocial/63-zzz/profile">Actor</a></div>
<div><a href="/groups/viewgroup/test/5-second-group">Group other</a></div>
</li>
<li>7 element.</li>
<li><div><a href="/groups/viewgroup/test/8-second-group">First group</a></div></li>
<li><div><a href="/groups/viewgroup/16-other-group">First group</a></div></li>
<li><div><a href="/j1.5/index.php?option=com_community&view=groups&task=viewgroup&groupid=1&Itemid=4">My other group </a></div></li>
</ul>
</div>
我的阵列:
var ids = [“1”,“8”,“3”,“4”,“5”]
我需要获取此输出(LI标签包含带有groupid的A标签在数组中):
<div id="els">
<ul><li><div>
<a href="javascript:void(0);">Actor</a>
<a href="/groups/viewgroup/1-first-group">Group one</a>
</div>
</li>
<li>
<div>6 element. <a href="/j1.5/index.php/jomsocial/63-zzz/profile">Actor</a></div>
<div><a href="/groups/viewgroup/test/5-second-group">Group other</a></div>
</li>
<li><div><a href="/groups/viewgroup/test/8-second-group">First group</a></div></li>
<li><div><a href="/j1.5/index.php?option=com_community&view=groups&task=viewgroup&groupid=4&Itemid=4">My other group </a></div></li>
</ul>
</div>
谢谢你们!