What are the Three Types of Buttons in HTML?
The buttons used in HTML are broadly classified into three different categories. All the three types of HTML buttons are discussed below:
- The Submit Button- This button is used for submitting the current data entered into a web form.
- The Reset Button- This button is used for resetting all the currently entered data within a web form.
- The Simple Clickable Button- This is a simple HTML button that is used for triggering any associated event.
How to use the Three Types of Buttons in HTML?
For using all the three types of buttons in HTML, we have created the following HTML script:
In this example, we have created two text input fields for collecting the first name and last name of the users. Then, we provided three different buttons in this HTML script. The first button will be used for submitting the first and last name entered. The second button will be used for resetting the entered input. And the last button will be used to trigger an associated event. However, in this HTML script, we have confined ourselves to the creation of these buttons because of which we have not defined any associated trigger events.
The web page shown in the image below appeared on our browser when we executed the above-mentioned HTML script. This web page shows all three types of buttons in HTML.