title: Determining child index in it's parent
body: <p>How can I determine index of an element in it's parent? Assume you have following DOM structure and you have set a <em>click</em> event listener for child divs. When each of them is clicked, I want to know it's index regarding the parent div.</p>
  
  <pre><code>&lt;div class="parent"&gt;
      &lt;div class="child"&gt;...&lt;/div&gt;
      &lt;div class="child"&gt;...&lt;/div&gt;
      &lt;div class="child"&gt;...&lt;/div&gt;
      &lt;div class="child"&gt;...&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>