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>
<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 オブジェクト その他の拡張