//disable the button
document.getElementById(BUTTON_ID).disabled = true;
//reable the button
document.getElementById(BUTTON_ID).removeAttribute('disabled');
// Makes the button disabled
document.getElementById("myButtonId").setAttribute("disabled", "");
// Removes disabled attribute
document.getElementById("myButtonId").removeAttribute("disabled");
//to enable btn
let temp
temp = document.getElementById("saveBtnId") as HTMLButtonElement
if (temp) {
temp.removeAttribute('disabled');
}
//disable
if (temp) {
temp.disabled = true;
}
document.getElementById(BUTTON_ID).disabled = true;
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById("Button").disabled = true;
});
// 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);
});
document.getElementById("submitButtonId").disabled = true;