How to use Form onreset in JavaScript
This article describe about Form onreset Event in JavaScript.
Form onreset Event
When reset button on the from is clicked onreset event occurs.
Syntax
Parameter |
Description |
JavaScriptCode |
Required. Specifies a JavaScript to be executed when the event occurs |
Example
<!DOCTYPE html>
<html>
<body>
<p>Enter some text in the input fields, then click on the Reset button to reset the form.</p>
<form onreset="alert('The form will be reset')">
Enter Firstname: <input type="text" name="fname" value="Satya" /><br />
Enter Lastname: <input type="text" name="lname" value="prakash" />
<br /><br />
<input type="reset" value="Reset" />
</form>
</body>
</html>
|
Output

Note: After click on the reset button output become.

You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here