---
pageClass: rule-details
sidebarDepth: 0
title: vue/html-button-has-type
description: disallow usage of button without an explicit type attribute
since: v7.6.0
---
# vue/html-button-has-type
> disallow usage of button without an explicit type attribute
Forgetting the type attribute on a button defaults it to being a submit type.
This is nearly never what is intended, especially in your average one-page application.
## :book: Rule Details
This rule aims to warn if no type or an invalid type is used on a button type attribute.
```vue
```
## :wrench: Options
```json
{
"vue/html-button-has-type": ["error", {
"button": true,
"submit": true,
"reset": true
}]
}
```
- `button` ... ``
- `true` (default) ... allow value `button`.
- `false` ... disallow value `button`.
- `submit` ... ``
- `true` (default) ... allow value `submit`.
- `false` ... disallow value `submit`.
- `reset` ... ``
- `true` (default) ... allow value `reset`.
- `false` ... disallow value `reset`.
## :rocket: Version
This rule was introduced in eslint-plugin-vue v7.6.0
## :mag: Implementation
- [Rule source](https://github.com/sxzz/eslint-plugin-vuekit/blob/main/lib/rules/html-button-has-type.ts)
- [Test source](https://github.com/sxzz/eslint-plugin-vuekit/blob/main/tests/lib/rules/html-button-has-type.test.ts)