- HTML Basics
- HTML Home
- HTML Basics
- HTML Document Structure
- HTML Data Types
- HTML Attributes
- HTML Fonts
- HTML Headings
- HTML Character Entities
- HTML Horizontal Line
- HTML Line Break
- HTML Paragraph
- HTML Citation Definition
- HTML Quotations
- HTML Comments
- HTML Styles
- HTML Formatting
- HTML CSS
- HTML Tags
- HTML Basic Tags
- HTML All Tags
- HTML Root Tags
- HTML Metadata Tags
- HTML Section Tags
- HTML Head Heading Tags
- HTML Flow Tags
- HTML Phrasing Tags
- HTML Embedded Tags
- HTML Interactive Tags
- HTML Meta Tags
- HTML Texts
- HTML Text Formatting
- HTML Physical Style Text
- HTML Logical Style Text
- HTML Organizing Text
- HTML Arranging Text
- HTML Displaying Lists
- HTML List
- HTML Links Tables
- HTML Links URLs
- HTML Links
- HTML URL Encode
- HTML Tables
- HTML Images Colors
- HTML Images Colors
- HTML Images
- HTML Color Codes
- HTML Canvas
- HTML Backgrounds
- HTML Forms
- HTML Forms
- HTML Form Tag
- HTML Input Tag
- HTML Button Tag
- HTML Multiple-Choice
- HTML Select Tag
- HTML Option Tag
- HTML Optgroup Tag
- HTML Textarea Label
- HTML Fieldset Legend
- HTML Datalist Tag
- HTML Keygen Tag
- HTML Output Tag
- HTML Progress Tag
- HTML Meter Tag
- HTML Submit Form
- HTML enctype Attribute
- HTML action Attribute
- HTML Method Attribute
- HTML Get Method
- HTML Post Method
- HTML Interactive
- HTML Interactive Web
- HTML Details Summary
- HTML Menu Tag
- HTML Command Tag
- HTML KBD Tag
- HTML Time Tag
- HTML Multimedia
- HTML Multimedia
- HTML Multimedia Tags
- HTML Audio Video
- HTML Embedded Multimedia
- HTML EMBED Tag
- HTML OBJECT Tag
- HTML FIGURE FIGCAPTION
- HTML Advance
- HTML Blocks
- HTML Classes
- HTML Iframes
- HTML JavaScript
- HTML Layouts
- HTML Responsive
- HTML Test
- HTML Online Test
- Give Online Test
- All Test List
HTML BUTTON Tag
In HTML, the BUTTON tag is used to add a button control on the form. A button control can be used to perform various tasks, such as submitting or resetting the details of the form.
The BUTTON tag can be used with the conjunction of FORM tag to display the controls on the form. A button control can also be placed on the form by using the INPUT tag, but the difference is that you do not have the scope to change the appearance of the button control, except changing the text on the button control. However, you can change the appearance of the button control in case you have created the button control by using the BUTTON tag.
The button control is created by using the opening and the closing tags of the BUTTON tag. The text, image, or any multimedia embedded between the opening and the closing tags of the BUTTON tag become the content of the button control.
The BUTTON tag provides a type attribute that allows you to create three kinds of button controls i.e. submit button, reset button, and normal button. The submit button is used to submit the form, whereas the reset button is used to erase all the text entered in the text box of the form and set the default values.
The submit button is created by setting the type attribute to submit, the reset button is created by setting the type attribute to reset, and the normal button is created by setting the value of the type attribute to button.
Attributes of the BUTTON tag
The following table describes the various attributes of the BUTTON tag :
Attribute | Description |
---|---|
autofocus | Allows the button control to get the focus as soon as page loads |
disabled | Disables the button control |
form | Refers to the id of the FORM tag |
formaction | Refers to the value of the action attribute of the current form |
formenctype | Specifies a value that is used to encode the content while submitting to the server. The possible values are application/x-www-form-urlencoded (default), multipart/form-date, text/plain |
formmethod | Specifies the methods of the HTTP at the time of the submitting the button control. The possible values are get, post, put, and delete |
formnovalidate | Specifies that the form is not to validate at the time of submitting the button control |
formtarget | Specifies the destination, such as a new tab or a new window, to load the browsing context |
name | Provides a name of the button control |
type | Specifies the type of the button control. The possible values are submit, reset, and button |
value | Provides a value to the button control. You can use this attribute if the form attribute is present |
« Previous Tutorial Next Tutorial »