HTML | DOM Input Hidden type Property
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;" >w3wiki </ h1 > < h2 >DOM Input Hidden type Property </ H2 > < form id = "myBeginner" > < input type = "hidden" id = "GFG" name = "myBeginner" value = "w3wiki" > </ form > < button onclick = "myBeginner()" >Submit</ button > < p id = "sudo" style = "color:green;font-size:30px;" > </ p > < script > function myBeginner() { 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