title: How can I make a timer subtract five minutes when a buton is pressed?
body: <p>I'm making a riddle where people have 45 minutes to find the solution, but I want the timer to go down five minutes when they answer incorrectly to prevent them from just guessing the answer. This is what I have for the timer:</p>
  
  <pre><code> function startTimer(duration, display) {
     var start = Date.now(),
       diff,
       minutes,
       seconds;
  
     function timer() {
       diff = duration - (((Date.now() - start) / 1000) | 0);
  
       minutes = (diff / 60) | 0;
       seconds = (diff % 60) | 0;
  
       minutes = minutes &lt; 10 ? "0" + minutes : minutes;
       seconds = seconds &lt; 10 ? "0" + seconds : seconds;
  
       display.textContent = minutes + ":" + seconds;
  
       var cat1 = $("input[@name=Verdachte]:checked");
  
  
       if (cat1.val() != "2") {
         cat1.val("you are right :)");
         cat1.attr("disabled", true);
         start -= 1000 * 60 * 5;
       }
  
       if (diff &lt;= 0) {
         start = Date.now() + 1000;
       }
     };
  
     timer();
     setInterval(timer, 1000);
   }
  
   window.onload = function() {
     var fortyfiveMinutes = 60 * 45,
       display = document.querySelector('#time');
     startTimer(fortyfiveMinutes, display);
   }
  </code></pre>
  
  <p>But it just keeps subtracting five minutes all the time, so I made a send button for it: </p>
  
  <pre><code>$("#results").click(function() {
        if (cat1.val() === "2") {
          cat1.val("you are right :)");
          cat1.attr("disabled", true);
          start -= 1000 * 60 * 5;
        }
      };
  </code></pre>
  
  <p>But now the timer just disappears completely, how can I fix this?</p>