title: prevent multiple button pressing
body: <p>I have a simple countdown that is activated by a button. Using <code>onclick</code> i start the action, but I noticed that if you keep pressing the button it increases the time and the countdown is out of sync. How would I go about preventing this from happening, and only allowing one click at a time?</p>
  
  <pre><code>  var count = 10,
        startcounter = document.getElementById("stercount");
  
  startcounter.onclick = function() {
    countdown = setInterval(function(){
      document.getElementById("countdown").innerHTML = count + " seconds remaining!";
      if (count &lt;= 0) {
        clearInterval(countdown);
        document.getElementById("countdown").innerHTML = "Done!";
      }
      count--;
    }, 1000);
  };
  </code></pre>
  
  <p>DEMO: <a href="http://jsfiddle.net/StWXk/1/" rel="nofollow">http://jsfiddle.net/StWXk/1/</a>
  ​</p>