screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <title>Beautiful UI with CSS</title> </head> <body> <div class="container"> <h3>Javascript Disable Button for 5 Seconds</h3> <button id="myButton" onclick="disableButton()">Click me</button> </div> <script> function disableButton() { const button = document.getElementById("myButton"); button.disabled = true; button.innerText = "Wait for 5 seconds..."; setTimeout(() => { button.disabled = false; button.innerText = "Click me"; }, 5000); } </script> <style> body { font-family: Arial, sans-serif; background-color: #f2f2f2; } .container { max-width: 400px; margin: 0 auto; padding: 20px; background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); border-radius: 5px; text-align: center; } h3 { color: #333; margin-bottom: 20px; } #myButton { padding: 10px 20px; background-color: #007bff; color: #fff; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease; } #myButton:hover { background-color: #0056b3; } #myButton[disabled] { background-color: #ccc; cursor: not-allowed; } /* Optionally, change the color of the text on the disabled button */ #myButton[disabled] { color: #666; } </style> </body> </html>