elibraryportal Logo

HTML Button Tag

The <Button> Tag is used to creating a button within HTML form on your webpage.

Syntax:-

Example:-

Test it Now

Attributes of HTML Button Tag

<button> tag supports all global attributes and some specific additional attributes.

There is given a list of HTML button tag attributes.

Attribute Value Description
autofocus autofocus It specifies that a button should automatically get focus while the loading of the page.
disabled disabled It specifies that a button shuld be disabled.
form form_id It specifies one or more forms that the button belongs to.
formaction URL It is used for submit type. It specifies where to send the form data when form is submitted.
formenctype application/x-www-form-urlencoded
multipart/form-data
text/plain
It specifies how form-data should be encoded before sending it to server.
formmethod get
post
It specifies how to send form-data.
formnovalidate formnovalidate It specifies that the form data should not be validated on submission.
formtarget _blank
_self
_parent
_top
framename
It specifies that where to display the response after submitting the form.
name name It specifies the name of the button.
type button
reset
submit
It specifies the type of the button.
value text It specifies the value of the button.

Next TopicHTML hr tag