Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
IMCreator - Free Website Builder

HTML button Tag

The information on this page is based on HTML version 4.01 (which is the current version of HTML). The next version, HTML 5, is currently being written. Here's a list of HTML 5 tags.

The HTML button tag is used for creating a button within forms.

Although you can also use the <input> tag to create an HTML button, the <button> tag does have some advantages. In particular, you can place HTML between the <button></button> tags. This enables you to do things you wouldn't normally be able to with the <input> tag.

Examples

Example 1:

This HTML button was created using the following code:

<form>
<button name="quackitButton" value="Submit" type="button">Click Me</button>
</form>

Example 2:

This button, which also contains an image, was created with the following HTML code:

<form>
<button name="quackitButton" value="Submit" type="button">
<img src="/pix/web_graphics/free_website_graphics/icons/books/book13.gif" alt="Read book" />
<br />Read Book!</button>
</form>
Attributes:
Attributes specific to this tag:
AttributeDescription
nameAssigns the name of the button control.
valueAssigns an initial value to the button.
typeSpecifies the type of button. Possible values:
  • submit (default)
  • reset
  • button
Other Attributes:
AttributeDescription
classDocument wide identifier.
idDocument wide identifier
langLanguage code
dirSpecifies the direction of the text
disabledDisables the button. The button won't work when clicked. It also cannot receive focus and will be skipped when tabbing.
accesskeyAccess keys (or shortcut keys)
tabindexHelps determine the tabbing order (when the user 'tabs' through the elements on the page).
titleSpecifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").
styleInline style (CSS)
onfocusIntrinsic event (see event handlers)
onblurIntrinsic event (see event handlers)
onclickIntrinsic event (see event handlers)
ondbclickIntrinsic event (see event handlers)
onmousedownIntrinsic event (see event handlers)
onmouseupIntrinsic event (see event handlers)
onmouseoverIntrinsic event (see event handlers)
onmousemoveIntrinsic event (see event handlers)
onmouseoutIntrinsic event (see event handlers)
onkeypressIntrinsic event (see event handlers)
onkeydownIntrinsic event (see event handlers)
onkeyupIntrinsic event (see event handlers)

Also see the HTML 5 version of HTML tags

Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!