title: Determine when HTML5 audio is paused or track is finished using jQuery
body: <p>I am working on an HTML5 audio tag and I want to trigger an event when the song is finished. Is this possible with jQuery?</p>
  
  <p>My jQuery code is:</p>
  
  <pre><code>      $(document).ready(function(){
  
  var music = new Audio("sample.mp3");
  $('#play').click(function(){
      music.play();
  });
  
  $('#pause').click(function(){
   music.pause();
  });
  
           });
  </code></pre>
  
  <p>My HTML5 is:</p>
  
  <pre><code>&lt;input type="button" value="Play" id="play" /&gt;
  &lt;input type="button" value="Pause" id=pause" /&gt;
  </code></pre>