I am trying to skip timer placed on an HTLM page. Javascript for the TIMER is below:
var t = 60;
var decr = 1;
var handle = null;
var e = null;
function startTimer() {
if(!e) e = document.getElementById("time");
e.innerHTML = t;
handle = setInterval(function() {
if(t == 0) {
clearInterval(handle);
var answer = confirm("Yes/No?")
if (answer){
alert("You Clicked Yes!")
window.location = "https://twitter.com/";
}
else{
alert("You Clicked No!")
}
}
else {
t -= decr;
e.innerHTML = t;
}
}, decr * 1000);
}
window.onload = startTimer;
What I want is to change the TIMER to 10 seconds as soon as the page gets loaded. I tried to enter the following code in browser location bar:
javascript:document.getElementById('time').innerHTML = "10";
But I'm not getting into it. What'll be the proper way to do it?