Hello, i need to create a web site with a decreasing timer and i got a syntaxError but i don’t know what to change:
var secondesrestantes;
var interval;
var boutonstart=document.getElementById("start");
boutonstart.onclick=function({
startminuteur(); //ERROR !
};
function reinitialiser(){
document.getElementById("tempsIndiqué").style.display="block";
}
function tick(){
var tempsrestant=document.getElementById("temps");
varmin=Math.floor(secondesrestantes/60);
var sec=secondesrestantes-(min*60);
if (sec<10){
sec="0"+sec;
}
var message=min.toString+":"+sec;
tempsrestant.innerHTML=message;
if(secondesrestantes===0){
alert("Done!");
clearInterval(interval);
reinitialiser();
}
secondesrestantes--;
}
function startminuteur(){
reinitialiser()
var minutes=Math.floor(document.getElementById("minutes").value);
if (isNaN(minutes)||minutes==""){
alert("Veuillez entrer un nombre");
return;
}
secondesrestantes==minutes*60;
interval=setInterval(tick,1000);
document.getElementById("tempsIndiqué").style.display="none";
}