title: find index of child using jQuery?
body: <p>If I have an html structure like:</p>
  
  <pre><code>&lt;div id="parent"&gt;
   &lt;div class="child first"&gt;
     &lt;div class="sub-child"&gt;&lt;/div&gt;
   &lt;/div&gt;
  
   &lt;div class="child second"&gt;
     &lt;div class="sub-child"&gt;&lt;/div&gt;
   &lt;/div&gt;
  
   &lt;div class="child third"&gt;
     &lt;div class="sub-child"&gt;&lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and I have a click handler defined through <code>($('#parent.child')).click()</code> and then I click on the div with the class of <code>second</code> (<code>first, second, third</code> classes have simply been added to make demo clearer) is there a simple way to get the number 1 as it is the second child? (0 based index)?</p>
  
  <p>Something like <code>$(this).index</code></p>