A quick example
<button id="btn">Click me</button> <script> // Button const btn = document.getElementById('btn'); // Disable the button btn.disabled = true; // Enable the button btn.disabled = false; </script>
If you add this code to a file and open it in a browser, the button will work as expected since we first disabled it and then enabled it again. Try to remove the line where we set the disabled state to false and try again. This time, the button will not work.