首页 > 代码库 > js founction

js founction

var sc = document.getElementById("kk");
var count = sc.innerText;
var nl;//全局变量
function change() {
//如果 var nl=setInterval("fun()",100);的话就是局部变量,下面的nl就用不了
nl = setInterval("fun()",100);
}
function fun() {
sc.innerText = count++;
}
function changeClear() {
clearInterval(nl);
}

js founction