HTML Button Tag

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

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.

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.