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 id="p1" ></p>
<div id="div1">
<p id="p2"></p>
</div>
<p id="p3"></p>
Is there some function that behaves thus?
$("#p1").isBefore($("#p2")); // == true
$("#p3").isBefore($("#p2")); // == false
$("#p1").isBefore(#("#p3")); // == true
Note that I care about position in the HTML tree of the document, not physical position on the screen.