Resetting forms to their default values can be done by reset() method of Javascript. The reset() method resets all fields of the form to their default value.s

In the example below, the city name is set to default name as “Bergen”, when the form is reset. The name field is set to null but the city field is set to "Bergen".

Example of reset() method in forms

 

›› go to examples ››