HTML DOM disabled 属性

定义和用法

form 属性可返回队包含该文本域的表单的引用。

若成功,该属性返回一个表单对象。

语法

textObject.form

实例

下面的例子为文本域所属的表单设置了 id:

<html>
<body>

<form id="form1">
<input type="text" id="text1" />
</form>

<p>The id of the form containing the text field is:
<script type="text/javascript">
x=document.getElementById('text1');
document.write(x.form.id);
</script></p>

</body>
</html>