title: Button Click shouldn't stack the function it triggers but it does
body: <p>I'm making an timer in Javascript which already works well the only problem is when I keep hitting the 
  "Start" button it keeps stacking the count function and will count at an higher and higher speed. Tried multiple things to stop it but can't manage myself.</p>
  
  <p>JS:</p>
  
  <pre><code>var startknop = document.getElementById("start");
  var stopknop = document.getElementById("stop");
  var hour = 0;
  var min = 0;
  var sec = 0;
  startknop.onclick = function()
  {
          intervalId = setInterval(count, 1000);
  }
  stopknop.onclick = function()
  {
      clearInterval(intervalId);
  
  }
  
      counter.innerHTML = hour + "0:" + min + "0:" + sec + "0";
  
      function count() {
  
          sec++;
          if(sec &lt;= 9)
          {
              var seco = "0" + sec;
          }
          else
          {
              seco = sec;
          }
          if(min &lt;= 9)
          {
              var mino = "0" + min;
  
          }
          else
          {
              mino = sec;
          }
          if(hour &lt;= 9)
          {
              var houro = "0" + hour;
          }
          else
          {
              houro = hour;
          }
          if(sec == 60){
              sec = 0;
              min += 1;
          }
          if(min == 60){
              min = 0;
              hour += 1;
          }
      counter.innerHTML = houro + ":" + mino + ":" + seco;
  }
  </code></pre>