HTML Tutorials

Submit and Reset buttons

Submit and Reset buttons help the user tell the browser what to do with the form. You can create buttons to either submit or reset your form, using the <input> element with the following type and value attributes:

1. Submit: Visitors have to tell a browser when they’re done with a form and want to send the contents. You create a button to submit the form to you by using the following markup:

<input type=”submit” value=”Submit”>

You don’t use the name attribute for the Submit and Reset buttons. Instead, you use the value attribute to specify how the browser labels the buttons for display.

2. Reset: Visitors need to clear the form if they want to start all over again or decide not to fill it out. You create a button to reset (clear) the form by using the following markup:

<input type=”reset” value=”Clear”>

You can set the value to anything you want to appear on the button. In our example, we set ours to Clear. Of course, you can use something that’s more appropriate to your website if you’d like.

The following is an example of markup to create Submit and Reset buttons named Send and Clear, respectively:

  <head> </head>
    <h1>HTML Form</h1>
    <hr />
      <form method="post">
        <h1>Name and Password</h1>
          First Name:
          <input type="text" name="firstname" size="30" maxlength="25" />
          Last Name:
          <input type="text" name="lastname" size="30" maxlength="25" />
          <input type="password" name="psswd" size="30" maxlength="25" />
        <h1>Favorite Foods</h1>
        <p>What are some of your favorite foods?</p>
          <input type="checkbox" name="food" value="pizza" checked="checked" />Pizza
          <input type="checkbox" name="food" value="icecream" /> Ice Cream
          <input type="checkbox" name="food" value="eggsham" /> Green Eggs and
        <h1>Gender Information</h1>
        <p>What is your gender?</p>
        <p><input type="radio" name="gender" value="male" />Male</p>
        <p><input type="radio" name="gender" value="female" />Female</p>
        <p style="line-height: 2em; margin: 2em">
          <input type="submit" value="Send" />
          <input type="reset" value="Clear" />
    <hr />
Favorite Foods

What are some of your favorite foods?


 Ice Cream

 Green Eggs and Ham

Gender Information

What is your gender?