title: Leading zeros in minutes
body: <p>I created a clock to be placed in the header of my website. The time is not displaying a zero for minutes &lt; 10. For example if the time is 10:50, it will only show 10:5 ,I found a solution but unsure of how to implement it. Also if there is a better method please share.</p>
  
  <pre><code> var current;
  window.onload = function () {
  
      current = new Date();
  
      document.getElementById("clock").innerHTML = current.getHours() + ":" +      current.getMinutes(); 
  </code></pre>
  
  <p>This is what I need   </p>
  
  <pre><code>                if (minutes &lt; 10)
                  minutes = "0" + minutes
  </code></pre>
  
  <p>and this is the container for my clock</p>
  
  <pre><code>    &lt;span id="clock"&gt;&amp;nbsp&lt;/span&gt;
  </code></pre>