Latest web development tutorials

HTML DOM Hidden form properties

Hidden Object Reference Hidden Objects

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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>

try it"


Hidden Object Reference Hidden Objects