x
 
<!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>