title: How can I make this timer start onclick
body: <p>I have made this timer script but I can't seem to make it so ti starts onclick.</p>
  
  <p>Here is my whole code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function display( notifier, str ) {
    document.getElementById(notifier).innerHTML = str;
  }
  
  function toMinuteAndSecond( x ) {
    return Math.floor(x/60) + ":" + x%60;
  }
  
  function setTimer( remain, actions ) {
    (function countdown() {
      display("countdown", toMinuteAndSecond(remain));actions[remain] &amp;&amp; actions[remain]();
      (remain -= 1) &gt;= 0 &amp;&amp; setTimeout(arguments.callee, 1000);
    })();
  }
  
  setTimer(20, {
                 20: function () { 
                      display("notifier", "seconds"); 
                 },
                 1: function () { 
                      display("notifier", "second");
                 },
  
                 0: function () { 
                      display("notifier", "seconds");
                 }
               }
  );
  &lt;/script&gt;
  
  &lt;!--Start Redirect Countdown--&gt;
  &lt;div id="redirect_box" style="display:block;"&gt;
  Redirecting in &lt;span id="countdown"&gt;&lt;/span&gt; &lt;span id="notifier"&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;!--End Redirect Countdown--&gt;
  
  &lt;div id="buttonn"&gt;Skip &gt;&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Skip >> is suppose be the button that starts the timer and the ID, countdown is the actual countdown. And, notifier is just an extra ID. 
  I hope someone can help</p>