Open In App

HTML | DOM Input Reset type Property

Last Updated : 18 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The Input Reset type Property in HTML DOM is used to return the type of form element of the reset field. It always returns the “reset” for an Input reset field.

Syntax:  

resetObject.type

Return Value: It returns a string value that represents the type of form element the Input reset field is.

Below program illustrates the reset type property in HTML DOM:
Example: This example returns the type of form element of the reset field. 

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
        HTML DOM Input reset type property
    </title>
</head>
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksForGeeks
    </h1>
    <h2>DOM Input reset type Property</h2>
    <input type="reset" id="GeekReset" value="Reset form">
     
<p>
        Click on below button to return the Property
    </p>
 
    <button onclick="myGeeks()">
        Click Here
    </button>
    <p id="Geek_p"></p>
 
    <script>
        function myGeeks() {
             
            // Return Input Reset type Property
            var x =
            document.getElementById("GeekReset").type;
            document.getElementById("Geek_p").innerHTML = x;
        }
    </script>
</body>
</html>


Output: 
Before Clicking the Button: 

After Clicking the Button: 

Supported Browsers: The browser supported by DOM Input Reset type Property are listed below: 

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


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

Similar Reads