title: JavaScript countdown timer for hour, minutes and seconds when a start button click
body: <p>I want to create countdown timer for hour,minute and second when a button click. This is my code so far.</p>
  
  <p>HTMLcode</p>
  
  <pre><code>&lt;div class="colomn" style="margin-right: 20px"&gt;
     &lt;button class="start" onclick="clock();"&gt;Start&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>javascript function</p>
  
  <pre><code>&lt;script&gt;
   var myTimer;
   function clock() {
          myTimer = setInterval(myClock, 1000);
          var c = 5;
  
          function myClock() {
              document.getElementById("demo").innerHTML = --c;
                 if (c == 0) {
                     clearInterval(myTimer);
          }
        }
      }
    &lt;/script&gt;
  </code></pre>
  
  <p>This is simple and not showing separate hour,min and sec. How can I apply this for count hour,min and sec. Please help me.</p>