Javascript examples for DOM HTML Element:Input Submit
Disable the submit button after it's pressed
<html> <head></head> <body> <p>Click the button to trigger a function.</p> <button id="demo">Click me</button> <script> var nbSubmits = 0;/*w w w .j a v a 2 s . c o m*/ document.getElementById("demo").onclick = function (){ nbSubmits++; if(nbSubmits == 20) { document.getElementById("demo").disabled="true"; } } </script> </body> </html>