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 1
- Edge 12
- Firefox 1
- Opera 2
- Safari 1
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
31 Aug, 2022
Like Article
Save Article