Open In App

How to create a Reset Button in form using HTML ?

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:

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






<!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:




Article Tags :