Javascript examples for DOM HTML Element:Button
Button disabled Property - Disable and enable a button:
<!DOCTYPE html> <html> <body> <button id="myBtn">My Button</button> <br><br> <button onclick="disableBtn()">Disable "My Button"</button> <button onclick="enableBtn()">Enable "My Button"</button> <script> function disableBtn() {/*from w w w. j av a 2 s . c om*/ document.getElementById("myBtn").disabled = true; } function enableBtn() { document.getElementById("myBtn").disabled = false; } </script> </body> </html>