HTML DOM Hidden type 属性

[

Hidden type 属性
Hidden 对象

定义和用法

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>

Hidden 对象

]
转载请保留页面地址:https://www.breakyizhan.com/html/21535.html
原文地址:https://www.cnblogs.com/breakyizhan/p/13286387.html