Jquery how can i count the index number from parent?
<p>i have a this function to count the index number, but i need to count it from it's parents parent, so my result of index would be 0,1,2.</p>

<p>how can i do this?</p>

<p>myfuntion://</p>

<p>​html:</p>

<pre><code>&lt;div id="parent"&gt;
    &lt;div class="child1"&gt;
        &lt;h3&gt;title one&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="child1"&gt;
        &lt;h3&gt;title one&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="child1"&gt;
        &lt;h3&gt;title one&lt;/h3&gt;
    &lt;/div&gt;
&lt;/div&gt;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
</code></pre>

<p>Jquery:</p>

<pre><code>​$('h3','#parent')​​​​​​​​​.click(function(){
    alert($(this).index('#parent'))            
})​
</code></pre>
