Javascript examples for DOM HTML Element:Input Submit
The type property returns the type of form submit button.
For a submit button object, this property will always return "submit".
Type | Description |
---|---|
String | The type of form element the submit button is |
The following code shows how to check which type of form element the Submit button is:
<!DOCTYPE html> <html> <body> <input type="submit" id="mySubmit"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//ww w . j a va 2s. c o m var x = document.getElementById("mySubmit").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>