$("ul").on("click", ".start", function() {
console.log("started");
var timeInput = $(this).parent().children('.time');
var timeInputValue = timeInput.val();
var milliSeconds = Number(timeInputValue)*60*1000;
console.log(milliSeconds);
setTimeout(() => {
audio.play();
alert("Time Over");
audio.pause();
$(this).parent().children('.task').toggleClass("completed");
}, milliSeconds);
})
<audio src="assets/audio/siren.mp3" id="audio"></audio>
I have no idea about this. I am kind of pulling app features out of the thin air and trying. So, obviously what I am doing is wrong because it doesn't work.
What I am trying to do is, make the setTimout function play an audio file. then would come an alert box, and after that a stop.
Please, help me with this.
Thank You