Javascript examples for DOM HTML Element:Input Button
Input Button disabled Property - Find out if a button is disabled or not:
<!DOCTYPE html> <html> <body> <input type="button" id="myBtn" value="My Button"> <br> <button onclick="disableBtn()">Disable "My Button"</button> <button onclick="undisableBtn()">Enable "My Button"</button> <script> function disableBtn() {/*from w ww. j a v a 2 s .co m*/ document.getElementById("myBtn").disabled = true; console.log(document.getElementById("myBtn").disabled); } function undisableBtn() { document.getElementById("myBtn").disabled = false; console.log(document.getElementById("myBtn").disabled); } </script> </body> </html>