title: How to catch 'stop' event in HTML5 audio and then do something?
body: <p>I'am beginner in HTML5 and not even middle in JS, but I'am trying to figure out how to correctly use <code>&lt;audio&gt;</code> and smth else... so i've got this question... my html:</p>
  
  <pre><code>&lt;i class='some_icon' onclick='play();'&gt;
    &lt;audio src='some_mp3.mp3' id='player'&gt;&lt;/audio&gt;
  &lt;/i&gt;
  </code></pre>
  
  <p>Now when I click on the icon I want some mp3 file play and it works because I wrote this js:</p>
  
  <pre><code>function play() {
      var my = document.getElementById('player');
      if (my.paused) {
        my.play();
      } else {
        my.pause();
        my.currentTime = 0
      }
    }
  </code></pre>
  
  <p>BUT, besides, I want to change my icon WHEN that mp3 file ENDS... how can I do that? Any help will be greatly appreciated :)</p>