element.scrollTop always returns 0
<p>I'm trying to get the scrollTop position of an element, but it always returns 0. What am I doing wrong, and how can I fix it?</p>
<p><a href="https://jsfiddle.net/nhg6uedj/" rel="noreferrer"><h3>JSFiddle</h3></a></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>var inner = document.getElementById('inner');

window.addEventListener('scroll', function() {
  console.log(inner.scrollTop);
})</code></pre>
<pre class="snippet-code-css lang-css prettyprint-override"><code>#outer {
  background-color: tan;
  height: 1000px;
}
#first {
  background-color: bisque;
  height: 200px;
}
#inner {
  background-color: aquamarine;
  height: 100px;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="outer"&gt;
  &lt;div id="first"&gt;&lt;/div&gt;
  &lt;div id="inner"&gt;scrollTop always returns 0&lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>