Created
April 24, 2013 09:39
-
-
Save stephane/5450978 to your computer and use it in GitHub Desktop.
Avoid multiple clicks on same DOM object and reactivates it after 5 seconds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function disable_a_moment(o) { | |
o.disabled = true; | |
o.value = o.value + "…"; | |
setTimeout(function() { | |
o.disabled = false; | |
o.value = o.value.substr(0, o.value.length - 1); | |
}, 5000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment