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) }