HTML Button Tag (original) (raw)

Last Updated : 23 May, 2026

The tag in HTML is used to create clickable buttons on a webpage. These buttons can trigger various actions, such as submitting a form, running JavaScript functions, or simply interacting with users.

**Syntax:

Click Me!

Centered Button Example Click Me!

`

Attributes

The various attributes that can be used with the "button" tag are listed below:

Attributes Descriptions
autofocus Specifies whether the button should automatically get focus or not when the page loads
disabled Indicate whether the element is disabled or not. If this attribute is set, the element is disabled.
form Create a form for user input. There are many elements that> are used within the >form tag.
formaction Specifies where to send the data of the form.
formnovalidate Specifies that the Input Element should not be validated when submitting the form.
formenctype Specifies that the form data should be encoded when submitted to the server.
formmethod Specifies the HTTP method used to send data while submitting the form.
formtarget Specifies the name or a keyword that indicates where to display the response after submitting the form.
type Specifies the type of button for button elements. It is also used in element to Specifies the type of input to display.
value Specifies the value of the element with which it is used. It has different meanings for different HTML elements.

**Note: It is important to specify the type attribute for a button element to inform the browser of the button's function.

Reset Button

A reset button resets all the form fields to their default values. It's created by setting the type attribute to reset inside the tag.

HTML `

Centered Reset Button Example