title: gett offset() coordinates of .each() element in a loop?
body: <p>How do you do this?</p>
  <p>So far this is what I'm trying:</p>
  <pre><code>var blogHeaders = $('.coa-content h2');
  $(window).scroll(function() {
      blogHeaders.each(function(i) {
          console.log(blogHeaders[i].offset().top);
      });
  })
  </code></pre>
  <p>This block of code is giving me the following:</p>
  <blockquote>
  <p>VM941:6 Uncaught TypeError: blogHeaders[i].offset is not a function</p>
  </blockquote>
  <p>I tried looking up &quot;offset() for each item in loop&quot; on here, these were the first 4 results:</p>
  <p><a href="https://stackoverflow.com/questions/25063556/vba-for-each-loop-only-excutes-once-and-then-stops">VBA For Each Loop only excutes once and then stops</a></p>
  <p><a href="https://stackoverflow.com/questions/58275801/wordpress-custom-post-loop-alternating-layout-for-each-item">WordPress Custom Post Loop / alternating layout for each item</a></p>
  <p><a href="https://stackoverflow.com/questions/50463547/shifting-scatter-points-for-each-array-for-delta-x">Shifting scatter points for each array for delta x</a></p>
  <p><a href="https://stackoverflow.com/questions/32521729/check-if-array-has-012-or-just-single-item">Check if array has [0][1][2] or just single item</a></p>
  <p>Unfortunately, none of these answers are relevant to my question.</p>
  <p>I googled &quot;offset() multiple elements in loop javascript&quot; but couldn't find any relevant answers there, either.</p>
  <p>Is there a way to do this? Or am I taking the wrong approach here?</p>