Current location - Loan Platform Complete Network - Foreign exchange account opening - javascrpt Regarding the problem that setInterval cannot call functions
javascrpt Regarding the problem that setInterval cannot call functions
var?i=0; function?ss(){

i++;

document.getElementById('show').value?=?i;

} window.onload=function(){?

var?timer?=?'';

var?but1?=?document.getElementById('but1');

p>

var?but2?=?document.getElementById('but2');

but1.onclick=function(){

timer?=?setInterval('ss ()',1000);

}

but2.onclick=function(){

clearInterval(timer);

} } Or window.onload=function(){?

var?timer?=?'';

var?but1?=?document.getElementById('but1');< /p>

var?but2?=?document.getElementById('but2');

var?i=0;

function?ss(){

i++;

document.getElementById('show').value?=?i;

}

but1.onclick=function() {

timer?=?setInterval(ss,1000);

}

but2.onclick=function(){

clearInterval (timer);

} }