title: Javascript: scrollBy function executed on a div
body: <p>I have a div with <code>overflow: scroll;</code> And I would like to put a button. When you press it, the content of the <code>div</code> scrolls. </p>
  
  <p>Something like:</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>function scrollDiv() {
    document.getElementById("d").scrollBy(100, 100);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="d"&gt;
    &lt;p&gt;Click the button to scroll by 100px.&lt;/p&gt;
    &lt;button onclick="scrollDiv()"&gt;Click me to scroll!&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This works in FF, but not in Chrome. In Chrome I get</p>
  
  <blockquote>
    <p>Uncaught TypeError: undefined is not a function</p>
  </blockquote>
  
  <p>The <code>scrollBy</code> function seems to be defined as <code>window</code> function, so I guess this is the problem, and it's working in FF not by standard.</p>
  
  <p>But is there another way to do that? I am not using jQuery, and I'd rather not.</p>