Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

HTML <button> type="button"

An <button> tag with a type="button" attribute creates a clickable button.

These buttons are commonly used to execute JavaScript.

Example

#

A <button> element of type button.
Clicking the button displays an alert box.

<button type="button" 
        onclick="alert('Calculations have been started!')">Start calculation</button>

Using button type="button"

The <button type="button"> tag creates a clickable button.

Buttons of this type are mostly used to execute JavaScript functions.

The button can contain text, images, icons, and other elements.


Syntax

<button type="button">...</button>

Browser support

Here is when type="button" support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <button>
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

Guides