Decide which object comes first in code
<p>Quick JQuery-question: How can one decide which of two objects comes first in a code?</p>

<p>Edit: I want to do something like this.</p>

<pre><code>var active = $("#second");
if(active is before $("#first")) ...
else ...
</code></pre>

<p>Ex:</p>

<pre><code>&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td id="first"&gt;  &lt;/td&gt;
&lt;td&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;table&gt;
&lt;tr&gt;
&lt;td id="second"&gt; &lt;/td&gt;
&lt;td&gt; &lt;/td&gt;
&lt;td&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>
