How to reset form in Jquery

Date Published: 15/10/2020 Published By: JaiSchool

<!DOCTYPE html>
	<title>reset form in jqery</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<script src=""></script>

<h1 align="center">Type something in Input field and click "Reset this form" button</h1>

<form class="my-form">
	<input type="text" name="firstname" placeholder="Your first name">
	<input type="text" name="lastname" placeholder="Your last name">
	<input type="email" name="email" placeholder="Type email here">
	<input type="submit" value="Register">

<button class="reset-btn">Reset this form</button>


Live example

Type something in Input field and click "Reset this form" button

Default values set to the INPUT field using value="something" can not be reset by this method.

More posts:-

Publish A Comment

Leave a Reply

Your email address will not be published. Required fields are marked *