Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM Input Hidden form Property

  • Difficulty Level : Basic
  • Last Updated : 14 May, 2021

The Input Hidden form property is used to return the reference of the form containing the Input Hidden field. It is read-only Property that returns a form object on success. 
Syntax: 
 

hiddenObject.form

Return Values: It returns a string value which specify the reference of the form containing the Input Hidden field

Below Program that illustrates the Input Hidden form property. 
Example-1: 
 

html




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

Output: 
Before Clicking On Button: 

 

After Clicking On Button: 
 

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

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!