Hidden typeProperty
Hidden Object
Definition and Usage
The type attribute returns the type of the form element.
For a hidden object, this property is always "hidden".
Syntax
hiddenObject.type
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the type attribute
Example
Example
The following example returns the type of the form element for the hidden field:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").type;
alert(x);
}
</script>
</head>
<body>
<form>
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">Display input type</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").type;
alert(x);
}
</script>
</head>
<body>
<form>
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">Display input type</button>
</body>
</html>
Try it Yourself »
Hidden Object Other Extensions