<input type="button" onclick="block();" id="x" value="GO"> <script> var button = document.getElementById("x") ; function block() { button.disabled = true ; setTimeout(function() { button.disabled = false ; }, 2000) ; } ; </script>