Skip to content
Related Articles

Related Articles

Improve Article

HTML | DOM Input Hidden type Property

  • Difficulty Level : Basic
  • Last Updated : 24 Jun, 2021

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

Return Values: It returns a string value which defines the type of form element the input hidden field is. 

Below program illustrates the Input Hidden type property:
Example: Returning the type of form element the Input Hidden type field is.
 

html




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

 

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :