Search
 
SCRIPT & CODE EXAMPLE
 

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)
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: How to get current URL with Javascript or React 
Javascript :: javascript check if undefined 
Javascript :: on mouse over in jquery 
Javascript :: sweet alert after click ok redirect 
Javascript :: js remove readonly attribute 
Javascript :: ERROR in ./server/server.js Module build failed (from ./node_modules/babel-loader/lib/index.js): 
Javascript :: how to unmount bottom tab screens 
Javascript :: javascript random number between 1 and 10 
Javascript :: Composer could not find a composer.json file in To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section 
Javascript :: vertical align center react native view 
Javascript :: node console log without newline 
Javascript :: reduce decimals to 4 digits javascript 
Javascript :: javascript disable right click 
Javascript :: check for internet explorer browser in javascript 
Javascript :: jquery trigger change event 
Javascript :: javascript current date add 30 days 
Javascript :: javascript throw vs console.error 
Javascript :: add url query in js 
Javascript :: javascript disable input 
Javascript :: discordjs 13 TypeError Valid intents must be provided for the Client. 
Javascript :: yarn create react app 
Javascript :: react empty space 
Javascript :: jquery validation errorplacement 
Javascript :: jquery select outer html 
Javascript :: javascript padstart 
Javascript :: update to specific version of node brew 
Javascript :: javascript get random floating number 
Javascript :: enzyme adapter react 17 
Javascript :: pass header in ajax 
Javascript :: js get time in am 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =