You are here: Reference > HTML > attributes > type (button)

type attribute (button)

Browser support:
Sets the type of a button.
With this attribute you can create the same type of buttons as with the input element, but with a more complex value. The 'submit' and 'reset' values have effect only within a form element.
JavaScript page for this attribute: type. You can find other example(s) there.

Possible values:

String that sets the type of the button.
One of the following values:
Default. Command button.
Reset button. The user can reset the contents of a form with this type of button.
Submit button. The user can submit (send to the server) the contents of a form with this type of button.
Default: button.

Example HTML code 1:

This example illustrates the use of the type attribute:
    <button type="submit">submit</button>
    <button type="reset">reset</button>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content