title: how to get child div index of a parent div. if there are several parent div with same class
body: <p>I have three parent div class as inner_box2. each of parent div contains more than five child div with class name inner_box_items.</p>
  
  <p>On click the child div's span it should return child div index/position inside the parent div. that is I have to click in the span inside the div.inner_box_items and it should return div.inner_box_items position inside inner_box2</p>
  
  <p>`</p>
  
  <pre><code>&lt;div class="inner_box2"&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="inner_box2"&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="inner_box2"&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
     &lt;div class="inner_box_items"&gt;&lt;span&gt;View Position&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>`</p>
  
  <p>trying like below. but not working..</p>
  
  <pre><code>var xyz=$(this).parents('.inner_box2').closest('.inner_box_items').index('.inner_box_items');
  </code></pre>