I have this page that wait 100 seconds and then writes "finish" on a button:
<html>
<head>
</head>
<body>
<form action="" name="submitform" method="POST">
<input name="submitbutton" type="submit" value="Submit">
</form>
<script language="JavaScript">
var time;
var timer;
time = 100;
timer = setTimeout("countdown()", 1000);
function countdown() {
time--;
document.submitform.submitbutton.value = "Submit (remaining " + time + " seconds)";
if (time > 0) {
timer = setTimeout("countdown()", 1000);
} else {
document.submitform.submitbutton.value = "finish";
}
}
</script>
</body>
</html>
if I click on f12 I can change the "time" value with the Chrome console like:
Time=1000
I want to create a Chrome extension that changes the "time" value, so I tried with this:
console.log('time=1000')
but obviously it doesn't work. I find the writing "time = 1000" but the value of "time" is not changed, and when I manually write it from the console the number 1000 is purple, instead after the execution of the chrome extension if I check the console the writing is there but the number is black.