To disable HTML button using JavaScript, we set the button’s disabled
property.
For instance, we write
document.getElementById("btnPlaceOrder").disabled = true;
to select the button with getElementById
.
Then we disable the button by setting is disabled
property to true
.