Input Hidden type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Hidden

Description

The type property returns the type of form element hidden input field.

For a hidden element the type is "hidden".

Return Value

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:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials