js 笔记

function funNumberCount() {
numTmp
= getCookie("numTmp");
document.getElementById(
'btnCount').value = numTmp;
numTmp
--;
if (numTmp == -1) {
clearInterval(interval);
document.getElementById(
'btnCount').disabled = false;
document.getElementById(
'btnCount').value = "发送短信";
}
setCookie(
"numTmp", numTmp, 1);
}

function btnClick() {
if (getCookie("numTmp") == ""||getCookie("numTmp")<="-1") {
setCookie(
"numTmp", 9, 1);
}
else {
interval
= setInterval(funNumberCount, 1000);
document.getElementById(
'btnCount').disabled = true;
return;
}
}
posted @ 2011-04-22 15:42  木由水  阅读(140)  评论(0编辑  收藏  举报