Open In App

HTML DOM Input Submit type Property

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. 






<!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: 

Supported Browsers:


Article Tags :