Dofactory.com
Dofactory.com
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 freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <input> type="button"

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

These buttons are commonly used to execute JavaScript.

Example

#

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

<input type="button" 
       value="Start calculations"
       onclick="alert('Calculations have been started!')">

Using input type="button"

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

Input element of this type are mostly used to execute JavaScript functions.


Syntax

<input type="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 <input>

Last updated on Sep 30, 2023

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 freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides