Open In App

How to create a Reset Button in form using HTML ?

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

In this article, we will learn how to create a Reset Button in HTML forms.  The reset button is used to reset all the form data values and set them to their initial default value. In case of user enters the wrong data then the user can easily correct it by clicking on the “Reset Button”.

Syntax:

<input type="reset">

Approach:

  • First, we have to create a form using <form> element.
  • Create an <input> element under the form element.
  • Use the type attribute with the <input> element.
  • Set the type attribute to the value “reset”.

Example: In this example, we will use the input element for creating a reset button.

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>
        How to Create a Reset Button
        in form using HTML?
    </title>
</head>
 
<body style="text-align:center;">
 
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    <h2>
        How to Create a Reset Button
        in form using HTML?
    </h2>
    <form>
        Email ID:
        <input type="email">
        <br>
        <br> Password:
        <input type="password">
        <br><br>
 
        <input type="submit">
        <input type="reset">
    </form>
</body>
 
</html>


Output:



Last Updated : 23 Jan, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads