title: Finding the index of a specific type of element relative to the entire page?
body: <p>I have several images sorted like this:</p>
  
  <pre><code>&lt;div&gt;
      &lt;img src="img.png"&gt;&lt;img src="img.png"&gt;&lt;img src="img.png"&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;img src="img.png"&gt;&lt;img src="img.png"&gt;&lt;img src="img.png"&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;img src="img.png"&gt;&lt;img src="img.png"&gt;&lt;img src="img.png"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When using <code>.index()</code>, it returns the index relative to the parent. So if I used it on the second element of the third row, it would return 1 when I would want it to return 7. Is there a way to get the index relative to the entire page, as well as only counting <code>img</code> tags?</p>