Hidden type 屬性

定義和用法
type 屬性可返回表單元素的類(lèi)型。
對(duì)于 hidden 對(duì)象,該屬性總是 "hidden"。
語(yǔ)法
hiddenObject.type
瀏覽器支持
所有主要瀏覽器都支持 type 屬性
實(shí)例
實(shí)例
下面的例子返回了該隱藏域的表單元素類(lèi)型:
<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>
嘗試一下 ?

更多建議: