Relative position in DOM of elements in jQuery
<p>Given two jquery objects, Is there some way I tell which one is "further ahead" in the document tree than the other? In other words, with a document</p>

<pre><code> &lt;p id="p1" &gt;&lt;/p&gt;
 &lt;div id="div1"&gt;
    &lt;p id="p2"&gt;&lt;/p&gt;
 &lt;/div&gt;
 &lt;p id="p3"&gt;&lt;/p&gt;
</code></pre>

<p>Is there some function that behaves thus?</p>

<pre><code>$("#p1").isBefore($("#p2")); // == true
$("#p3").isBefore($("#p2")); // == false
$("#p1").isBefore(#("#p3")); // == true
</code></pre>

<p>Note that I care about position in the HTML tree of the document, not physical position on the screen.</p>
