Transversing a JQuery object?
<p>I'm doing sorting of a list of elements, using:</p>

<pre><code>jQuery.fn.sort = function() {
   return this.pushStack( [].sort.apply( this, arguments ), []);
 };


$("ol li").sort("sortFunction").appendTo("ol");
</code></pre>

<p>The problem is in the sortFunction.</p>

<pre><code>function sortFunction($a, $b) {
  ...
}
</code></pre>

<p>Basically, what I want is to treat both $a and $b as jQuery objects, so I can manipulate them.</p>

<p>e.g, inside the sortFunction do </p>

<pre><code>$a.find("div#3 li").html();
</code></pre>

<p>This doesn't work since $a and $b are native javascript objects.</p>

<p>Any help?</p>
