たとえば、リンクのグループはほとんどありません。
<a href="http://google.com/b">http://google.com/b</a>
<a href="http://google.com/a">http://google.com/a</a>
<a href="http://stackoverflow.com/g">http://stackoverflow.com/g</a>
<a href="http://google.com/c">http://google.com/c</a>
<a href="http://stackoverflow.com/a">http://stackoverflow.com/a</a>
<a href="http://en.wikipedia.org/c">http://en.wikipedia.org/c</a>
<a href="http://en.wikipedia.org/a">http://en.wikipedia.org/a</a>
<a href="http://en.wikipedia.org/b">http://en.wikipedia.org/b</a>
google.com のリンクと wikipedia.org のリンクを並べ替えて、その位置を維持する必要がありますが、私の質問は並べ替えに関するものではありません。要素のグループでの反復に関する私の質問。私の例では、次のようになります。
$("a[href*='google.com'], a[href*='en.wikipedia.org']").each(function(){
// I need in $(this) google.com links in first iteration, and wikipedia.org links in second
});
それを行うためのネイティブな方法はありますか?
PS wrap() は不可能であり、追加の機能を実行したくありません。