<html>
<body>
<p>Write something in the text field and press the Reset button.</p>
<form onreset="myFunction()">
<input type="text" id="myInput">
<input type="reset">
</form>
<script>
function myFunction() {
var x = document.getElementById("myInput");
alert("Before reset, the text was: " + x.value);
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onreset2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:04:55 GMT -->
</html>