title: Get index of li in multiple parents
body: <p>I have a loop through all the elements in each li. What I'm trying to do is find the index of each el relative to the group-fields div. 
  I have an array of all the el's inside the each li tag. </p>
  
  <pre><code>for (var i = 0; i &lt; arr.length; i++) {
        var el = arr[i];
        var li = el.closest('li');
        console.log( "li index =", li.index() );
  }
  </code></pre>
  
  <p>The above is giving me the index relative to each parent which is the index of each li inside col-1 and then index of each li inside of col-2. I want to know the index of each element in relation to the top most element group-fields. </p>
  
  <p><strong>loose HTML Example:</strong> </p>
  
  <pre><code>&lt;div class="group-fields"&gt;
    &lt;div class="col-1"&gt;
      &lt;ul&gt;
        &lt;li&gt;
          &lt;input&gt;el&lt;/input&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;input&gt;el&lt;/input&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;div&gt;el&lt;/div&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div class="col-2"&gt;
      &lt;ul&gt;
        &lt;li&gt;
           &lt;div&gt;el&lt;/div&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;input&gt;el&lt;/input&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;input&gt;el&lt;/input&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>