Javascript examples for DOM HTML Element:Input Button
The Input object represents an HTML <input> element with type='button'
You can access a <input type='button'> element by using getElementById():
<!DOCTYPE html> <html> <body> <button type="button" onclick="myFunction()">disable the BUTTON element</button> <input type='button' id="myBtn" value='asdf'></button> <p id="demo"></p> <script> function myFunction() {/*from w ww. jav a2 s.co m*/ var x = document.getElementById("myBtn"); x.disabled = true; } </script> </body> </html>