Input Button type Attribute

Definition and Usage

type The property returns what type of form element the input button is.

For the input button, this property will always return "button".

Example

Returns the type of form element that the input button is:

var x = document.getElementById("myBtn").type;

Try It Yourself

Syntax

buttonObject.type

Technical Details

Return Value: A string value that represents the form element type of the input button.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support