Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

disable a button in javascript for a time period

const btn = document.getElementById("myBtn")
function myFunction() {
  btn.disabled = true;
  setTimeout(()=>{
    btn.disabled = false;
    console.log('Button Activated')}, 5000)
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #disable #button #javascript #time #period
ADD COMMENT
Topic
Name
5+2 =