代码示例:(标识:event_onreset_1)
<!DOCTYPE html>
<html>
<body>

<p>当您重置表单时,会触发提示文本的函数。</p>

<form onreset="myFunction()">
  Enter name: <input type="text">
  <input type="reset">
</form>

<script>
function myFunction() {
  alert("The form was reset");
}
</script>

</body>
</html>
运行结果: