How to get the index of an element without 'this'?
<p>I have a form that looks kind of like this:</p>

<pre><code>&lt;div&gt;
    &lt;div class="contact"&gt;
        &lt;h1&gt;Person's name&lt;/h1&gt;
        &lt;!-- more stuff goes here --&gt;
        &lt;form method="post" action="myurl"&gt;
            &lt;input type="submit" value="go" /&gt;
        &lt;/form&gt;
    &lt;/div&gt;
    &lt;div class="contact"&gt;
        &lt;h1&gt;Another name&lt;/h1&gt;
        &lt;!-- more stuff goes here --&gt;
        &lt;form method="post" action="myOtherUrl"&gt;
            &lt;input type="submit" value="go" /&gt;
        &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I'm using jQuery to capture the form's <code>submit</code> event and need to get the index of the <code>div</code> containing the button that submitted it. Normally I'd use jQuery's <a href="http://docs.jquery.com/Core/index" rel="nofollow"><code>index()</code></a> function like so:</p>

<pre><code>var i = $(this).parents('.contact').index(this);
</code></pre>

<p>Unfortunately, the <code>this</code> operator in this case refers to the <code>form</code> that is being submitted. I think there's probably something simple I'm missing, but my mind's drawing a blank on this one.</p>
