HTML - how to use <button> tag

The <button> tag defines a clickable button. This is similar to a input button element but is more powerful in terms of styling. The <button> tag allows styling of the content, for example, bold, italics and also supports images. Note that the type attribute should be set as different browsers have different default behavior.


The address tag supports the global and event attributes.

This indicates that the button will get focus by default when the page loads.
This indicates that the button is disabled.
This indicates the form element that this button relates to. The value should contain the id of the form.
This indicates the URL that processes the form when submitted. This works only when the type is set to "submit" and overrides the form's action attribute.
This indicates that the encoing of the form data when type is set to "submit".
When the type is set to "submit", this indicates how to send the form data. Allowed values are "get" and "post".
This indicates that the form should not be validated when type is set to "submit".
This indicates where to display the response obtained from the server when then form is submitted when type is set to "submit". Allowed values include:
  • _self:
  • _blank:
  • _parent:
  • _top:
This indicates a name for the button
This indicates the type of the button. Allowed values are "submit", "button" and "reset".
  • submit: the button will send data to the server.
  • button: no default behavior. Javascripts can be added to the button.
  • reset: the button will reset the form.
This indicates the initial value of the button


<div> <button name="button" type="submit">Click <i>me</i></button> </div>