当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM reset() 方法

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM reset() 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 384 ::
收藏到网摘: n/a

Definition and Usage
定义与用法

The reset() method resets the values of all elements in a form (the same as clicking the Reset button).
reset()方法可将表单中的所有元素值重置。

Syntax 语法

formObject.reset()


Example 举例

<html>
<head>
<script type="text/javascript">
function formReset()
{
document.getElementById("myForm").reset()
}
</script>
</head>
<form id="myForm">
Name: <input type="text" size="20"><br />
Age: <input type="text" size="20"><br />
<br />
<input type="button" onclick="formReset()" value="Reset">
</form>
</body>
</html>


演练

Reset a form
重置表单

评论 (0) All

登陆 | 还没注册?