按鈕指定時間開啟
<button id="test">我同意</button>
<script type="text/javascript">
var counts=10;
var counting;
function countDown()
{
var test = document.getElementById("test");
test.disabled = true;
counting = setInterval("countOne();",1000);
}
function countOne()
{
var test = document.getElementById("test");
test.firstChild.nodeValue = "我同意"+counts; if(counts-- == "0") {
test.firstChild.nodeValue = "我同意";
test.disabled = false; clearInterval(counting); }
}
</script>
我同意 開始計時
文章標籤
全站熱搜
