<button id="send">允许点击</button>
var wait = 10;
 function time(o){
     if(wait==0){
         o.innerHTML = "允许点击";
         o.removeAttribute('disabled',true);
                 wait = 10
      }else{
            o.innerHTML = "无法点击"+wait;
             console.log(wait)
             o.setAttribute('disabled',true);
             wait--;
              setTimeout(function(){
               time(o)
     },1000)
  }        
 }
            document.getElementById('send').onclick = function(){
                time(this)
            }

 

相关文章:

  • 2022-02-01
  • 2021-07-29
猜你喜欢
  • 2022-12-23
  • 2021-10-10
  • 2021-07-22
  • 2021-11-09
  • 2021-05-20
相关资源
相似解决方案