1. 程式人生 > >按鈕倒計時

按鈕倒計時

clear title mit link pre ttr inter attr logs

【轉自】按鈕倒計時

<a id="submit" class="pointer folwbtn">同意(<span id="tdown">9</span>)</a>

<script type="text/javascript">
$(function () {
var cout = 9;
var cdown = setInterval(fndown, 1000);
function fndown() {
$("#tdown").text(cout);
if (cout == 0) {
clearInterval(cdown);
$("#submit").attr("href", "<%= linkurl("services","form") %>").text("同意服務協議");
}
cout--;
}
});
</script>

按鈕倒計時