So I have in my javascript an if statement. When it returns true it opens an alert box and plays an alarm sound. The problem is that the sound doesn\'t play until I hit th
You can use:
var snd = new Audio('/alarm.mp3'); snd .onended = function () { alert("Thank you!"); }; snd .play();