I am having troubles with some jQuery code when I click a button very quickly. So to solve this I need to only allow users to click a button every 2 seconds or so. How can I make a button only clickable every 2 seconds (or whatever time I choose)?
Share
Assuming you’re using
<button>or<input>,jsFiddle DEMO
The
2000is the length of time before the button is re-enabled, in milliseconds