Hello how can i disable a button with the bind function for 10 sec?
jQuery('#wsf-1-field-155').bind('click', function() {
ScanRegistration();
setTimeout(function() {
jQuery('#wsf-1-field-155').bind();
}, 10000);
})
Hello how can i disable a button with the bind function for 10 sec?
jQuery('#wsf-1-field-155').bind('click', function() {
ScanRegistration();
setTimeout(function() {
jQuery('#wsf-1-field-155').bind();
}, 10000);
})
3
Answers
I solved this Problem with this, I change
.removeProp
with.removeAttr
.bind()
is deprecated. You should use.on()
instead.You don’t use event binding to disable a button, you set its
disabled
attribute. Then useremoveAttr()
to re-enable it after 10 seconds.Here’s a plain JavaScript solution.
scanRegistration()
just counts up to 10sec.Details are commented in example