HTMLButtonElement: type property - Web APIs | MDN
Value
A string representing the type.
Its possible values are listed in the attribute's button types section.
Example
HTML
html
<button id="button" type="reset">type</button>
JavaScript
js
const buttonElement = document.querySelector("#button");
console.log(buttonElement.type); // "reset"
Specifications
| Specification |
|---|
| HTML # dom-button-type |
Browser compatibility
See also
HTMLTextAreaElement.typepropertyHTMLInputElement.typeproperty