The type
property returns the type string of the hidden input field.
type |
Yes | Yes | Yes | Yes | Yes |
var v = hiddenObject.type
A String type value representing type string of the hidden input field.
The following code shows how to get type string of the hidden input field.
<!DOCTYPE html>
<html>
<body>
<input type="hidden" id="myInput">
<button onclick="myFunction()">test</button>
<!-- w w w. ja v a 2s . c om-->
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myInput").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: