W3Schools.com

HTML5 <button> type Attribute

HTML5 button Tag Reference HTML5 <button> tag

Example

A form with two buttons. One submit button and one reset button:

<form action="demo_form.asp" method="get">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<button type="submit" value="Submit">Submit</button>
<button type="reset" value="Reset">Reset</button>
</form>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The type attribute is supported in all major browsers.


Definition and Usage

The type attribute specifies the type of button.

Tip: Always specify the type attribute for the button. Different browsers use different default values for the type attribute.


Differences Between HTML 4.01 and HTML5

None.


Syntax

<button type="button|submit|reset">

Attribute Values

Value Description
button The button is a clickable button
submit Default. The button is a submit button (submits form-data)
reset The button is a reset button (clears form-data)


HTML5 button Tag Reference HTML5 <button> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE