HTML Button Type Attribute
HTML Button Type Attribute
Dark code
HTML CSS
Menu Log in
Example
Two button elements that act as one submit button and one reset button (in a form):
</form>
Try it Yourself »
Tip: Always specify the type attribute for the <button> element. Different browsers
may use different default types for the <button> element. Dark mode
https://www.w3schools.com/tags/att_button_type.asp
D k d 1/7
30/11/22, 12:32 HTML button type Attribute
Dark code
HTML CSS
Browser Support
Attribute
Syntax
<button type="button|submit|reset">
Attribute Values
Value Description
reset The button is a reset button (resets the form-data to its initial
values)
ADVERTISEMENT
Dark mode
https://www.w3schools.com/tags/att_button_type.asp
D k d 2/7