Hidden formProperty

Hidden 对象参考手册Hidden Object

Definition and Usage

The form property returns a reference to the form object that contains the hidden input field.

This property returns the form object.

Syntax

hiddenObject.form


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the form property


Example

Example

The following example returns the id of the form to which the hidden input field belongs:

<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()">Show the form's id</button>

</body>
</html>

Try it Yourself »


Hidden 对象参考手册Hidden Object Other Extensions