How to enable a button in JavaScript?

To enable a button in JavaScript, do this: button.removeAttribute('disabled').

For example, if this is your disabled button:

<button id="my-button" disabled="disabled">Click Me</button>

Then you can enable it with this JavaScript:

document.getElementById('my-button').removeAttribute('disabled');