HTML <button> Type AttributeIntroductionIn the HTML page, we can specify the button with the help of the button attribute value. It will be set in the web browser as a button element. The default types of <button> elements can vary from browser to browser. Syntax for button type attribute:We can specify the button type attribute with the help of the below syntax: Attribute ValuesThree types of attribute values are used in the button tag. With the help of this type of attribute value, we can specify the work of the button tag.
Let's take an example for each attribute value. Example 1:Output: Explanation: In the above code, we create a form. It will accept the data from the user. When the user clicks the submit button, all the values will be stored in the server. Example 2:Output: Explanation: In the above code, we create a form. It will accept the data from the user. When the user clicks the submit button, all the values will be stored in the server. When the user clicks the reset button, it will clear the whole page. Example 3:Output: Explanation: In the above code, we create a form. It will accept the data from the user. When the user clicks the submit button, all the values will be stored in the server. When the user clicks the reset button, it will clear the whole page. Also, we have created a button tag. Users can sign themselves on the webpage when they click on it. Supported BrowsersThe browsers supported by HTML <button> type attribute are listed below:
Next TopicHTML Hide Element |