title: Find row index using jQuery
body: <pre><code>&lt;div class="parent"&gt;
    &lt;div class="formRow js-TextBox"&gt;&lt;a&gt;&lt;/div&gt;  &lt;------ index 0
    &lt;div class="formRow js-Image"&gt;&lt;a&gt;&lt;/div&gt; &lt;------ index 1
    &lt;div class="formRow js-TextBox"&gt;&lt;a&gt;&lt;/div&gt;&lt;------ index 2
    &lt;div class="formRow js-ImageList"&gt;&lt;------ index 3
    &lt;div class="formRow js-Image"&gt;&lt;a&gt;&lt;/div&gt; &lt;-- **This should return 3 but is returning 4 because I search index on the basis of formRow**
  &lt;/div&gt;
  </code></pre>
  
  <p>Code to find the <code>formRow</code> index</p>
  
  <pre><code>var parent = $(this).parents("div.formRow");
  var rowIndex = parent.parent().find("div.formRow").index(parent);
  </code></pre>
  
  <p>Please refer to above code and advise how I can find the index of <code>formRow</code> for which I have clicked on anchor element <code>a</code>.</p>
  
  <p>The problem is that the last form row contains another <code>formRow</code>, but I want the index of parent form row.</p>