title: How do I set javascrip to disable selection after timer reached 0?
body: <p>I want to disable the selection box, after the countdown timer reached 0, is it possible to do it in javascript? I'm struggling to put the functions in the timer function... </p>
  
  <pre><code>&lt;html&gt;
  &lt;p id="demo"&gt;10&lt;/p&gt;
  &lt;button onclick="clock()"&gt;Start counter&lt;/button&gt;
  &lt;button onclick="clearInterval(myTimer)"&gt;Stop counter&lt;/button&gt;
  
  &lt;div class="box"&gt;
      &lt;p&gt;Cell Background Colour:  
           &lt;select id="bgcolour" class="color" name="cbc"&gt;
              &lt;option value="black"&gt;Black&lt;/option&gt;
              &lt;option value="white" selected&gt;White&lt;/option&gt;
          &lt;/select&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>Above is html, this is the javascript. </p>
  
  <pre><code>&lt;script&gt;
  var selection = document.getElementByClass("box");
  var timesUp = document.getElementsById('c')[0];
  
  timesUp.addEventListener('c', function(event) {
      button.disabled = !button.disabled;
  });
  
  var myTimer;
  
  function clock() 
  {
    myTimer = setInterval(countclock, 1000);
    var c = 10;
    function countclock()
   {
     document.getElementById("demo").innerHTML = --c;
  
      if (c == 0) {
          clearInterval(myTimer);
          timesUp();
      }
   }
  }
  
  function timesUp() {
      alert("Times up");
  
  }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>