Hidden type 屬性

定義和用法
type 屬性可返回表單元素的類型。
對於 hidden 對象,該屬性總是 "hidden"。
語法
hiddenObject.type
流覽器支持
所有主要流覽器都支持 type 屬性
實例
實例
下麵的例子返回了該隱藏域的表單元素類型:
<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>
