How to hide a button in JavaScript?

To hide a button in JavaScript, do this: button.style.display = 'none'.

For example, if this is your button:

<button id="my-button"></button>

Then you can hide it with this JavaScript:

document.getElementById('my-button').style.display = 'none'