JavaScript 中 onreset 事件有什么用途?
当表单重置时,onreset 事件很有用。您可以尝试运行以下代码来了解如何在 JavaScript 中实现onreset 事件 -
示例
<!DOCTYPE html>
<html>
<body>
<script>
function resetFunct() {
alert("The form was reset");
}
</script>
<form onreset = "resetFunct()">
Enter age: <input type = "number"><br>
Enter birth month: <input type = "text"><br>
<input type = "reset">
</form>
</body>
</html>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP