Open In App

HTML DOM Input Submit type Property

Last Updated : 29 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The Input Submit type Property in HTML DOM returns the type of form element of the submit field. It always returns the submit for an Input submit field.

Syntax:

submitObject.type

Return Values: It returns a string that represents the type of form element an input submit field is. 

Example: This example returns the type of form element of the submit field. 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM Input Submit type Property
    </title>
</head>
 
<body style="text-align:center;">
    <h1>GeeksforGeeks</h1>
     
    <h2>HTML DOM Input Submit type Property</h2>
 
    <form id="myGeeks">
        <input type="submit" id="Geeks"
            value="Submit @ geeksforgeeks">
    </form>
 
    <p>
        Click on below button to Get Input
        Submit Type Property Value
    </p>
 
    <button onclick="myGeeks()">
        Click Here!
    </button>
 
    <p id="result"></p>
 
    <!-- Script to return submit type Property -->
    <script>
        function myGeeks() {
            let btn = document.getElementById("Geeks").type;
            document.getElementById("result").innerHTML = btn;
        }
    </script>
</body>
 
</html>


Output: 

submit-type

Supported Browsers:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera
  • Safari 1


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads