There is a button on the website that looks like this:
https://i.sstatic.net/G7PBF.png
Clicking on this button triggers the following script:
https://i.sstatic.net/rIdLW.png
function count(){
let downloadTimer;
var timeleft = 30;
downloadTimer = setInterval(countDown,1000)
function countDown(){
document.getElementById("aaa").innerHTML = "Wait " ;
document.getElementById("hid").style.display = "none";
document.getElementById("timer").innerHTML = timeleft ;
timeleft -= 1;
if(timeleft < 0){
clearInterval(downloadTimer);
document.getElementById("timer").innerHTML = "1414-YYYI"
}
}
$(window).blur(function(){
console.log("blurred")
clearInterval(downloadTimer);
})
$(window).focus(function(){
console.log("focused")
downloadTimer = setInterval(countDown,1000);
})}
I am trying to modify the timeleft variable value when I run the count() function using Google Console. However, even though I can successfully run the count() function, I am unable to change the timeleft variable.
Here is an image showing how I attempted to manipulate the timeleft variables through the Google Console.