title: Parsing and showing HTML audio current time with javascript
body: <p>I'm working on a plain JavaScript + HTML audio player and at this time I want to build a interface that show the current time of the audio in the form "MM:SS".
  For what I could search the <a href="http://www.w3schools.com/tags/ref_av_dom.asp" rel="nofollow" title="HTML Audio/Video DOM Reference">HTML Audio/Video DOM Reference</a> has only one native function - <code>audio|video.currentTime</code> - that return the current audio time in seconds with a large decimal precision.</p>
  
  <p>In order to do this I code:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;audio id='audio' src="http://www.stephaniequinn.com/Music/Canon.mp3" controls&gt;&lt;/audio&gt;
  &lt;div id="timer"&gt;00:00&lt;/div&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>var audio = document.getElementById('audio'),
        timer = document.getElementById('timer');
  
  var update = setInterval(function() {
  
    timer.innerHTML = audio.currentTime;
  }, 10);
  </code></pre>
  
  <p>I tried a bunch of thing but I could not format the output the way I wanted.
  Hope some of you guys can bring some light on this.</p>
  
  <p><a href="https://codepen.io/joaosaragossa/pen/grKQmy" rel="nofollow" title="Codepen sample">Codepen sample</a></p>