Skip to content
Related Articles

Related Articles

HTML | DOM Input Hidden type Property
  • Difficulty Level : Basic
  • Last Updated : 12 Apr, 2019

The DOM input Hidden type Property is used for returning the type of form element the hidden input field is.
The Input Hidden type returns a string value which represents the type of form element the hidden input field is.

Syntax:

hiddenObject.type

Below program illustrates the Input Hidden type property:

Example: Returning the type of form element the Input Hidden type field is.




<!DOCTYPE html>
<html>
  
<body>
    <center>
        <h1 style="color:green;">GeeksForGeeks </h1>
        <h2>DOM Input Hidden type Property </H2>
        <form id="myGeeks">
            <input type="hidden" id="GFG" 
                   name="myGeeks" value="GeeksForGeeks">
        </form>
  
        <button onclick="myGeeks()">Submit</button>
  
        <p id="sudo" style="color:green;font-size:30px;">
        </p>
  
        <script>
            function myGeeks() {
                var x = document.getElementById("GFG").type;
                document.getElementById("sudo").innerHTML = x;
            }
        </script>
  
</body>
  
</html>

Output:
Before clicking on the button :

After clicking on the button:

Supported Browsers: The browser supported by DOM input Hidden type Property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :