# Bad value X for attribute “type” on element “button”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-type-on-element-button
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `type` attribute on a `<button>` only accepts three keywords — `submit`, `reset`, and `button` — so any other value is rejected.

`type` is an enumerated attribute, not a free-form one. `submit` posts the form (and is what a button does when the attribute is absent), `reset` clears the form fields, and `button` does nothing on its own and is meant to be wired up with JavaScript. Anything outside that set is invalid markup, and the browser falls back to `submit`, so a button you expected to stay inert may submit the form instead.

If you want the default behavior, leave the attribute off or write `type="submit"` explicitly; if the button should not submit, use `type="button"`.

## Invalid example

```html
<button type="default">Save</button>
```

## Valid example

```html
<button type="submit">Save</button>
```
