Reset form 属性

定义和用法
form 属性可返回对包含该重置按钮的表单的引用。
若成功,该属性返回一个表单对象。
语法
浏览器支持
所有主要浏览器都支持 form 属性
实例
实例
Display the id of the form containing the Reset button:
<head>
<script>
function displayResult()
{
var x=document.getElementById("reset1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
Email: <input type="text" id="email">
<input type="reset" id="reset1">
</form>
<button type="button" onclick="displayResult()">Display id of container form</button>
</body>
</html>
