js 倒计时退出

<p>您已提交成功!<span id='submit_second'></span></p>
 $("#submit_second").text(6);
t1 = window.setInterval("submit_second()",1000);
function submit_second() {
            var num = $("#submit_second").text();
                num--;
            $("#submit_second").text(num);
            if(num == 0) {
                window.clearInterval(t1);
                alert("退出");
            }
        }

  

posted @ 2017-11-09 14:46  不拨牙  阅读(324)  评论(0编辑  收藏  举报