How to reset form in jquery or javascript

You can rest form using the following jquery :

Below are two functions which can reset form in jquery.

Solution 1 : How to reset form in jquery


function resetMyForm1(){

or you can reset the  form using javascript :

Solution 2 : How to reset form in jquery or JavaScript

You can reset the form using javascript as below:

function resetMyForm2(){

You can call the above function on button click example:

<button type="button" onclick="resetMyForm2()">Reset Form </button>


<button type="button" onclick="resetMyForm1()">Reset Form </button>

Add Comment

📖 Read More