HTML | PHP | Forum

HTML <button> tag


<button> - </button>

Definition and Usage

The BUTTON element defines a submit button, reset button, or push button. Authors can also use INPUT to specify these buttons, but the BUTTON element allows richer labels, including images.

Optional Attributes

Attribute Value Description
disabled disabled Disable the button
name button_name Specify a name (unique) for the button
type button
Define the type of the button: button for a push button, reset for a reset button and submit for a submit button
value some_value Specify an initial value for the button. The value can be changed by a script

A submit button submit a form, a reset button resets all controls to their initial value and a push button does not have a default behavior. You can assign a script to a button to execute a particular action.

Standard Attributes

id, class, title, style, dir, lang, xml:lang, accesskey, tabindex

For a full description, go to Standard Attributes.

Event Attributes

onfocus, onblur, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


Source Output
<button> test button </button>


Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<h1> to <h6>


Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us