title: Fastest way to get elements in viewport
body: <p>I am dynamically creating a VERY large HTML file with as many elements as the browser on any given computer can feasibly generate.</p>
  
  <p>I then need to, as the user scrolls, access the elements of a certain type (let's say div) that are actually within the viewport.</p>
  
  <p>The only way I know how to get a list of the elements visible in the viewport is to loop through all elements and then see if their bounds overlap with the current viewport.  The problem with this is that there are so many elements in the document that this process can not complete quickly enough to let the browser scroll.</p>
  
  <p>Is there a faster way to get all elements within the viewport?</p>