HTML CSS examples for HTML Tag:button
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.
<!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>