Hidden typeProperty

Hidden 对象参考手册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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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>

Try it Yourself »


Hidden 对象参考手册Hidden Object Other Extensions