Latest web development tutorials

HTML DOM Hidden type property

Hidden Object Reference Hidden Objects

Definition and Usage

type property returns the type of form elements.

For the hidden object, the attribute is always "hidden".

grammar

hiddenObject.type


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute type


Examples

Examples

The following example returns the type of the form element 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"


Hidden Object Reference Hidden Objects