Javascript examples for DOM HTML Element:Input Submit
The disabled property sets or gets whether a submit button should be disabled.
Set the disabled property with the following Values
Value | Description |
---|---|
true|false | Sets whether a submit button should be disabled |
A Boolean, returns true if the submit button is disabled, otherwise it returns false
The following code shows how to disable a Submit button:
<!DOCTYPE html> <html> <body> <input type="submit" id="mySubmit"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w ww.j a v a 2s .c om*/ document.getElementById("mySubmit").disabled = true; } </script> </body> </html>