- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML - Button Tag
Description
The HTML <button> tag is used for creating a button within HTML form. You can also use <input> tag to create similar buttons.
Example
<!DOCTYPE html> <html> <head> <title>HTML Button Tag</title> </head> <body> <form> <button name = "button" value = "OK" type = "button">Click Me</button> </form> </body> </html>
This will produce the following result −
Global Attributes
This tag supports all the global attributes described in HTML Attribute Reference
Specific Attributes
The HTML <button> tag also supports the following additional attributes −
Attribute | Value | Description |
---|---|---|
autofocus | autofocus | Specifies that the button should have input focus when the page loads. |
disabled | disabled | Specifies the button is disabled. |
form | form_id | Specifies the forms to which button belongs. |
formaction | URL | Specifies the link where the form submits. |
formenctype | application multipart/form-data text/plain |
Specifies how the form data is encoded before sending it to server. |
formmethod | get post |
Specifies how to send form data. |
formnovalidate | formnovalidate | Specifies that the form data should not be validated. |
formtarget | _blank _self _parent _top |
Specifies where the response should be validated. |
name | name | Specifies the button name. |
type | button reset submit |
Specifies the button type. |
value | text | Specifies button's initial value. |
Event Attributes
This tag supports all the event attributes described in HTML Events Reference
Browser Support
Chrome | Firefox | IE | Opera | Safari |
---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes |
html_tags_reference.htm
Advertisements