Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript disable button

//disable the button
document.getElementById(BUTTON_ID).disabled = true;
//reable the button
document.getElementById(BUTTON_ID).removeAttribute('disabled');
Comment

make button disabled javascript

// Makes the button disabled

document.getElementById("myButtonId").setAttribute("disabled", ""); 

// Removes disabled attribute

document.getElementById("myButtonId").removeAttribute("disabled");
Comment

disable a button in javascript

//to enable btn
let temp
   temp = document.getElementById("saveBtnId") as HTMLButtonElement
   if (temp) {
     temp.removeAttribute('disabled');
   }

//disable
if (temp) {
     temp.disabled = true;
   }
Comment

javascript disable button

document.getElementById(BUTTON_ID).disabled = true;
Comment

button disabled javascript

document.addEventListener("DOMContentLoaded", function(event) {
  document.getElementById("Button").disabled = true;
});
Comment

disable button 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);
});
Comment

button disable in js

document.getElementById("submitButtonId").disabled = true;
Comment

PREVIOUS NEXT
Code Example
Javascript :: Burger menu bulma React 
Javascript :: strpos in javascript 
Javascript :: add toolbar button quill.js 
Javascript :: clear element children js 
Javascript :: string.contains javascript 
Javascript :: mongoBD increment 
Javascript :: Handle click outside a component in react with hooks 
Javascript :: invoke in js 
Javascript :: reverse array without using another array js 
Javascript :: javascript empty array 
Javascript :: get current url react router 
Javascript :: append line break javascript 
Javascript :: js create p element with text 
Javascript :: includes method javascript 
Javascript :: aes 256 nodejs 
Javascript :: mongodb unwind 
Javascript :: javascript check if property exists in object 
Javascript :: come andare a capo su javascript 
Javascript :: javascript arrow function 
Javascript :: passport local mongoose 
Javascript :: javascript filter array of objects by array 
Javascript :: jquery not readonly 
Javascript :: object.fromentries 
Javascript :: javascript object 
Javascript :: async await class component react 
Javascript :: if variable is string javascript 
Javascript :: Limit text to specified number of words using Javascript 
Javascript :: express add delay 
Javascript :: reverse json.stringify 
Javascript :: javascript getelementbyid parametrized 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =