title: How can I get my counter to stop at 0? It decrements to negative numbers
body: <p>What's wrong with my code? I can't get the timer to stop at 0. It keeps going down to negative numbers. I have my clearInterval set, why isn't the timer stopping?</p>
  
  <pre><code>var seconds = 30;
  
  $("#timer").on("click", run);
  
  $("#timer").on("click", show);
  
  var timer;
  
  function run() {
  
      clearInterval(timer);
      timer = setInterval(decrement, 1000);
  
  }
  
  function decrement() {
  
      seconds--;
      $("#timer").html("&lt;h2&gt;" +"Time Remaining: " + seconds + "&lt;/h2&gt;");
  
  }
  
  // Stop function
  
  function stop() {
  
      clearInterval(timer);
  
  }
  
  // When seconds hit zero
  
  if (seconds === 0) {
  
      stop();
      alert("Time's Up!");
  
  }
  </code></pre>