Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Button type Property

Button type Property

Button Object Reference Button Object


Definition and Usage

The type property sets or returns the type of the button.

Tip: Always specify the type attribute for a button. The default type in IE is "button", while in other browsers (and in the W3C specification) it is "submit".

Syntax

buttonObject.type=

value

The type property can have the following values:

Value Description
submit button is a submit button (the default value for all browsers except IE)
button button is a clickable button (the default value of IE)
reset button is a reset button (clears form data)

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type property.


Example

Example

Return the type of the button:

Try it »


Button Object Reference Button Object