shah rushabh shah rushabh - 1 month ago 4
HTML Question

How to clear form data jquery?

I want to clear all form input data after a submitting all input data to php file how can I clear this data by using jquery function?


You can listen to the submit event and then clear the values of each input like below:

$('#form').submit(function() {
<script src=""></script>
<form id="form">
  <input type="text" />
  <input type="submit" />