play audio till it ends javascript code example Example: html play audio programmatically document.getElementById('yourAudioTag').play();