Issue with playing Audio files one by one using JavaScript

We are able to play one Audio file at a time, using a button click event.
If we are trying to play two Audio files one by one in an order, using the same button click event; second audio file’s sound is over-lapping the first audio file.
Pls help us in resolution of this issue.

If you use for example audio.js to help you handle playing the audio tracks, there is a trackEnded event which you can use to start playing the next one.