HTML DOM Hidden type 屬性

2018-08-04 20:40 更新

Hidden type 屬性

Hidden 對(duì)象參考手冊(cè) Hidden 對(duì)象

定義和用法

type 屬性可返回表單元素的類(lèi)型。

對(duì)于 hidden 對(duì)象,該屬性總是 "hidden"。

語(yǔ)法

hiddenObject.type


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 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>

嘗試一下 ?


Hidden 對(duì)象參考手冊(cè) Hidden 對(duì)象
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)