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