By default html forms are reset and all fields are cleared when we submit them.
However, in instances whereby you use the preventDefault()
method in the JavaScript file, the form doesn’t reset automatically.
In such situations, we have to trigger the reset event manually using the following
JavaScript method:
document.getElementById("formId").reset();