button type='reset' - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:button

Introduction

If you set the type attribute to reset, pressing the button causes all of the input elements in the form to be reset to their initial state.

There are no additional attributes available when you use the button element in this way.

The following code shows the addition of a reset button to the HTML document.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body> 
      <form method="post" action="http://example.com/form"> 
         <p> 
            <label for="fave">
               Fruit: <!--  ww  w  .j a  v a2  s. c  o  m-->
               <input autofocus id="fave" name="fave">
            </label> 
         </p> 
         <p> 
            <label for="name">
               Name: 
               <input id="name" name="name">
            </label> 
         </p> 
         <button type="submit">Submit Vote</button> 
         <button type="reset">Reset</button> 
      </form>  
   </body>
</html>

Related Tutorials