Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

settimeout js

// disable button using prop.

$(".button").click(function(){
  // disable button
  $(this).prop('disabled', true);

  // do something

  // below code enables button clicking after two seconds.
  setTimeout(() => {
    // enable button
  	$(this).prop('disabled', false);
  }, 2000);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #settimeout #js
ADD COMMENT
Topic
Name
6+9 =