Javascript examples for DOM HTML Element:Input Hidden
The type property returns the type of form element hidden input field.
For a hidden element the type is "hidden".
Type | Description |
---|---|
String | The type of form element the hidden input field is |
The following code shows how to check which type of form element the hidden input field is:
<!DOCTYPE html> <html> <body> <input type="hidden" id="myInput"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w. java2 s.co m var x = document.getElementById("myInput").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>