HTML DOM Hidden form properties
Definition and Usage
form property returns to the form that contains a reference to a hidden input field.
This property returns the form object.
grammar
hiddenObject.form
Browser Support
All major browsers support form properties
Examples
Examples
The following example returns the hidden input field belongs to the form id:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">显示表单form的id</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">显示表单form的id</button>
</body>
</html>
try it"
Hidden Objects