Open In App

HTML | DOM Input Submit Object

The Input Submit object in HTML DOM represents the HTML <input> element with type = “submit” attribute. 

Syntax:



document.createElement("INPUT")
document.getElementById("id")

Property Values:

Return Value: It returns the object, corresponding to the input submit action performed. 



Example 1: This example creates an Input Submit Object 




<!DOCTYPE html>
<html>
<head>
    <title>
        HTML DOM Input Submit Object
    </title>
</head>
<body>
    <h2>
        HTML DOM Input Submit Object
    </h2>
    <p>
        Click on the button to create
        submit button
    </p>
    <button onclick = "myGeeks()">
        Click Here!
    </button>
     
    <!-- Script to create submit button -->
    <script>
        function myGeeks() {
            var btn = document.createElement("INPUT");
            btn.setAttribute("type", "submit");
            btn.value = ("Submit @ geeksforgeeks");
            document.body.appendChild(btn);
        }
    </script>
</body>
</html>

Output: 

Before click on the button:

  

After click on the button:

  

Example 2: This example describes the access of an Input Submit Object 




<!DOCTYPE html>
<html>
<head>
    <title>
        HTML DOM Input Submit Object
    </title>
</head>
<body>
    <h2>
        HTML DOM Input Submit Object
    </h2>
    <p>
        Click on the button to create
        submit button
    </p>
    <input type = "submit" id = "Geeks"
            value = "Submit @ geeksforgeeks">
    <button onclick = "myGeeks()">
        Click Here!
    </button>
    <p id = "GFG"></p>
     
    <!-- Script to create submit button -->
    <script>
        function myGeeks() {
            var btn = document.getElementById("Geeks").value;
            document.getElementById("GFG").innerHTML = btn;
        }
    </script>
</body>
</html>

Output: 

Before click on the button:

  

After click on the button:

  

Supported Browsers: The browser supported by DOM Input Submit Object are listed below:


Article Tags :