Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Reset Form Using jQuery</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $(".reset-btn").click(function(){ $("#myForm").trigger("reset"); }); }); </script> </head> <body> <form action="/examples/html/action.php" method="post" id="myForm"> <label>First Name:</label> <input type="text" name="first-name"> <input type="submit" value="Submit"> </form> <br> <button type="button" class="reset-btn">Custom Reset Button</button> </body> </html>