I have one problem with setInterval. When user select option(time) i would to time of setInterval change dynamic. This code works if user change from the first (select) and if he change from 10 to 1, not 1 to 10.
if i console.log(convertTime) i see dynamic change, but not in this setInterval..
Can I use your skills ? Thanks
Function inter() make random words
choiseTime.addEventListener("change", (e) =>
{
let timeSelect = e.target.selectedIndex;
convertTime = timeSelect * 1000;
inter();
setInterval(inter, convertTime);
if (timeSelect < 4)
{
alert.innerHTML = `En sélectionnant une durée de ${timeSelect}s vous irez sans doute trop vite. L'intervalle conseillé est de 4 à 7s par mot.`;
}
else
{
alert.innerHTML = "";
}
});