Javascript examples for DOM HTML Element:Input Button
Disable a button after clicking
<html> <head> <script> function myFunction() {// w ww .j a v a2s .c o m var b = document.getElementById('result'); b.innerHTML = 'You pressed the button.'; document.getElementById('button1').disabled = 'disabled'; return; } </script> </head> <body> <button onclick="myFunction()" id="button1">Press this</button> <div id="result"> You haven't pressed the button yet. </div> </body> </html>