讓按鈕失效幾秒(js)

此代碼可以防止用戶惡意點擊刷新

 


<input type="button" value="失效5秒" onclick="setTimeout((function(me){me.disabled=true;return function(){me.disabled=false;};})(this),5000);">

<input type="button" value=" 失效5秒 " onclick="{ this.disabled = true; var me = this; setTimeout(function()  me.disabled = false; }, 5000);
}">

<input type="button" value=" 失效5秒 " id="me" onclick="this.disabled=true;setTimeout('me.disabled=false',5000);">

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章