Im new to JS programing and into the programing in general and wanted to ask you how i can done that! I want this timer to play beepsound each second... The problem is that i dont know how to do it... Any help will be good!
The code:
var mTimeLeft = 120;
var timerRunning = false;
function timer(timeLeft) {
if (!timerRunning || timeLeft <= 0) {
timerRunning = false;
return;
}
if (timeLeft !== undefined) {
mTimeLeft = (timeLeft);
}
//Set something on the page to show the time left
$('#time-left').text(parseInt(mTimeLeft) + 'sec');
mTimeLeft--;
drawCircle(mTimeLeft * 0.833333);
if (mTimeLeft <= 0) {
timerRunning = false;
return;
}
setTimeout(timer, 1000);
}