title: Detect element that is being scrolled
body: <p>I have some divs on my page set to overflow: scroll, like so:</p>
  
  <p><a href="https://i.stack.imgur.com/kuRTz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kuRTz.jpg" alt="enter image description here"></a></p>
  
  <p>How can I detect which element is currently being scrolled or if the scroll is applied to the body? Event.target only returns the element over which the mouse is currently hovering as the scroll is applied, not the actual target.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.onscroll = function(e){
  
   console.log(e.target);
  
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body{
    background: white;
  }
  
  div{
    height: 50px;
    overflow: scroll;
    margin: 25px;
    background: black;
    color: white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  &lt;/div&gt;
  
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;
  Scroll&lt;br&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance!</p>