HTML DOM form 屬性
定義和用法
form 屬性可返回對包含該重置按鈕的表單的引用。
若成功,該屬性返回一個表單對象。
語法
resetObject.form
實例
下面的例子將返回該重置按鈕所屬的表單的 id:
<html>
<body>
<form id="form1">
<input type="reset" id="reset1" />
</form>
<p>The id of the form containing the reset button is:
<script type="text/javascript">
x=document.getElementById('reset1');
document.write(x.form.id
);
</script></p>
</body>
</html>