Hello evreyone I want to know how to continue setsetinterval function after clearing it starting from the last value
for example I created counter and i cleared it at the value "10" how to make it start counting again starting from the last value "10"
this is my code
let
div = document.getElementById("test");
button = document.getElementById("btn");
let time =_ =>
this.time = 0
counter = setInterval(function()
{
this.time = this.time+1;
div.innerHTML=this.time + "s"
}
,1000);
time()
button.onclick = function()
{
clearInterval(counter)
}`
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…