title: How to make an auto clicker in JavaScript?
body: <p>I'm currently making a clicker game and I wanted to know how to make a button that when I click on it, a number slowly goes up with intervals. I don't really know how to do the intervals and I've tried doing loops but loops are instant and have no intervals.</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 number = 0;
  
  function increase() {
    for (var i = 0; i &lt; 1; i++) {
      document.getElementById("number").innerHTML = number += 1
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button onclick="increase()"&gt;
      by 1
    &lt;/button&gt;
  &lt;div&gt;
    number:
    &lt;div id="number"&gt;
      0
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can someone turn this into an auto clicker? as said above, i just want to click on the button once and have the value of the variable "number" go up. Thanks.</p>