HTML:
<audio src="samples/brutaldeathmetal.mp3" id="audio" controls>
JavaScript:
var aud = document.getElementById('audio');
aud.addEventListener("ended", function(){
this.currentTime = 0;
this.pause();
});
this.currentTime = 0;
this.pause();
});
What this does is it sets the playtime back to zero seconds when the audio clip ends.
Among the many javascript functions and properties of this tag you can use .play(), .pause(), .ended, .paused, and .duration to manipulate it. And you can even set the .currentTime property to a number within the range of your clip's playback duration (in seconds) to start midway through the clip if you wanted.