The onreset
attribute event is triggered
when a form is reset.
The onreset
attribute is new in HTML5.
<elementName onreset="script">
<form>, <keygen>
onreset |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<body>
<!--from w ww . j a va 2s . c o m-->
<form onreset="myFunction()">
Enter name: <input type="text">
<input type="reset">
</form>
<script>
function myFunction() {
console.log("The form was reset");
}
</script>
</body>
</html>