Get Index Of Element Within UL
<p>Using jQuery, I'd like to be able to get the index of the li where the contained anchor tag's HREF equals "#All". (In this case the correct result would be 3)</p>

<pre><code>&lt;div id="tabs"&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="#CPU"&gt;&lt;span&gt;CPU&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#Pickup"&gt;&lt;span&gt;Pickup&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#Breakfix"&gt;&lt;span&gt;Breakfix&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#All"&gt;&lt;span&gt;All&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>I have tried:</p>

<pre><code>$("#tabs ul").index($("li a[href='#All']"))
</code></pre>

<p>...with no luck.  What am I doing wrong?</p>
