Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to create a Reset Button in form using HTML ?

  • Last Updated : 30 Sep, 2021

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

Approach: Here is a simple approach to add a reset Button –

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

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

Syntax

<input type="reset">

Example:

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:




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!