By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

HTML Button Tag

Reference on how to use the Button element of HTML. Includes a list of allowed attributes, and a useful example.

Edited: 2014-12-28 07:03

The HTML Button Element is used to create push buttons, these can either be used to submit a Form, or used together with JavaScript to complete a custom task.

Attributes

Attribute:Value:Description:
AttrsOther AttributesCommon, I18n, Event
DisabledDisabledDisables the Element
nameCharacter Data
valueCharacter Data
typebutton|submit|resetfor use as form button
tabindexNUMBERposition in tabbing order
accesskey{CHARACTER}position in tabbing order
onfocusScriptThe element got the focus
onblurScriptThe element lost the focus

HTML Button Example

<p><button>Push Me!</button></p>

You can also use images inside the button element, simply place a img element inside the button like shown in the below example.

<p><button><img src="/my-image.png" alt="Push Me!"></button></p>