jQuery基础应用:用jQuery过滤选择器实现在倒计时延时按钮。请大家帮我写一下,谢谢了。

2025-01-08 10:48:34
推荐回答(2个)
回答1:

 $(document).ready(function(){
                        
           var outSec = 5, timeId = setInterval(function(){
               if(outSec == 0){
                 clearInterval(timeId);
                 $("#button").click(clickButton).val('点击按钮');
                 return;
               }
               $("#button").val('点击按钮('+outSec+')');
               outSec -= 1;
           },1000)
       })

回答2: