how to get the index of a document element with jquery in the following case?
<p>I was wondering how to get the index of span with content itemEleven, with jquery in the following case. Assuming that we aren't able to get element by content value:</p>

<pre><code>    &lt;div&gt;  
        &lt;span class="itemSubMenu"&gt;itemOne&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemTwo&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemThree&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemFour&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemFive&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemSix&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemSeven&lt;/span&gt;  
    &lt;/div&gt;  
    &lt;div&gt;  
        &lt;span class="subMenuitemSubMenu"&gt;Something&lt;/span&gt;  
        &lt;span class="subMenuitemSubMenu"&gt;Something too&lt;/span&gt;  
    &lt;/div&gt;  
    &lt;div&gt;  
        &lt;span class="itemSubMenu"&gt;itemEight&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemNine&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemTen&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemEleven&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemTwelve&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemThirteen&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemFourteen&lt;/span&gt;  
        &lt;span class="itemSubMenu"&gt;itemFifteen&lt;/span&gt;  
    &lt;/div&gt;  
</code></pre>

<p>When i try to get, for example, itemEight with the following method.  </p>

<pre><code> $(".itemSubmenu").click(function(){
     alert($(this).index());  
 });  
</code></pre>

<p>It alerts 0, instead 9. Assuming that it is zero-based-index.</p>
