disable property to
document.getElementById("Provide id of the button").disabled = true;
Let's consider a coding example of this.
In the code above, we created two buttons. We click the second button to disable or enable the first button, as follows:
isDisabledvariable that stores the state of the button to be disabled or enabled.
View all Courses