title: Count down timer on button click
body: <p>So I created a count down timer that starts when the person clicks on the button. the countdown timer works but the issue i an running into are two things:</p>
  <ol>
  <li>if a person click on the button a second time it speeds up the timers</li>
  <li>If a person click on the button after the timer finish it starts to show a negative number.</li>
  </ol>
  <p>I am still learning Java and cannot figure this one out.</p>
  <pre><code>&lt;button 
  style=&quot;
  background:#f1b005;
  margin-bottom: 25px;
  border:0px;
  color: White;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  height:50px;
  width:125px;
  border-radius: 5px;
  align:center;
  cursor: pointer;&quot;
  onclick=&quot;onTimer()&quot;&gt;
  120 Sec Rest
  &lt;/button&gt;
  &lt;div 
  style=&quot;60px;
  font-size:30px;
  text-align:center;
  color:#f1b005;&quot;
  id=&quot;mycounter&quot;&gt;
  &lt;/div&gt;
  &lt;script&gt;
  i = 120;
  function onTimer() {
    document.getElementById('mycounter').innerHTML = i;
    i--;
    if (i &lt; 0) {
      alert('Times Up! Lets Get It!');
      clearInerval(i);
    }
    else {
      setTimeout(onTimer, 1000);
    }
  }
  &lt;/script&gt;
  </code></pre>