<audio id=audio src="sound.mp3" controls></audio> <button onclick="audio.play()"> play </button>
var counter = 3; audio.onended = function(){ counter --; if(counter > 0) this.play(); }