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

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.