Geek's Portal For Computers Graphics Operating Systems Multi-Media Networking Programming Data Format and  News
[ Start Page ] [ Contacting ] [ About ] [ Link To Us ] [ Geek Gear ] Thu, Aug 7 2008 
Free Internet Tools by web-geek.com Internet Tools
Administrator Tools
Name Server Look Up
Ping Test
Who Is
Trace Route

Web Developer Tools
Web Safe Colors
HTML Character Map
PopUp Generator
Body Color CSS v1.0
Browser Information
Meta Tag Generator
Keywords Generator
Link Popularity
JavaScript Escape / Unescape Converter
JavaScript Drop Down Menu Builder
Web / Virtual Hosting Directory

Reference Documention
HTML 4.0 Reference

Reference Tables
Character Conversion Table
Domain Name Suffixes

Cheat Sheets
Vi / Vim Basic Commands


WEB-GEEK.COM's Feature Sites Feature Sites
oGobogo Internet Search Directory
News.web-geek.com Internet News Directory
Pdawebgeek.com PDA Friendly Web Directory
Games.web-geek.com Free Online Games


folder HTML 4.0

BUTTON - Button

Syntax <BUTTON>...</BUTTON>
Attribute Specifications
  • NAME=CDATA (key in submitted form)
  • VALUE=CDATA (value in submitted form)
  • TYPE=[ submit | reset | button ] (type of button)
  • DISABLED (disable button)
  • ACCESSKEY=Character (shortcut key)
  • TABINDEX=Number (position in tabbing order)
  • ONFOCUS=Script (element received focus)
  • ONBLUR=Script (element lost focus)
  • common attributes
Contents
Contained in Block-level elements, inline elements except BUTTON

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 and emphasis. However, BUTTON is new in HTML 4.0 and poorly supported among current browsers, so INPUT is a more reliable choice at this time.

The TYPE attribute of BUTTON specifies the kind of button and takes the value submit (the default), reset, or button. The NAME and VALUE attributes determine the name/value pair sent to the server when a submit button is pushed. These attributes allow authors to provide multiple submit buttons and have the form handler take a different action depending on the submit button used.

Some examples of BUTTON follow:

  • <BUTTON NAME=submit VALUE=modify ACCESSKEY=M>Modify information</BUTTON>
    <BUTTON NAME=submit VALUE=continue ACCESSKEY=C>Continue with application</BUTTON>
  • <BUTTON ACCESSKEY=S>Submit <IMG SRC="checkmark.gif" ALT="&#10004;"></BUTTON>
    <BUTTON TYPE=reset ACCESSKEY=R>Reset <IMG SRC="x.gif" ALT="&#10008;"></BUTTON>
  • <BUTTON TYPE=button ID=toggler ONCLICK="toggle()" ACCESSKEY=H>Hide <strong>non-strict</strong> attributes</BUTTON>

The ACCESSKEY attribute, used throughout the preceding examples, specifies a single Unicode character as a shortcut key for pressing the button. Entities (e.g. &eacute;) may be used as the ACCESSKEY value.

The boolean DISABLED attribute makes the BUTTON element unavailable. The user is unable to push the button, the button cannot receive focus, and the button is skipped when navigating the document by tabbing.

The TABINDEX attribute specifies a number between 0 and 32767 to indicate the tabbing order of the button. A BUTTON element with TABINDEX=0 or no TABINDEX attribute will be visited after any elements with a positive TABINDEX. Among positive TABINDEX values, the lower number receives focus first. In the case of a tie, the element appearing first in the HTML document takes precedence.

The BUTTON element also takes a number of attributes to specify client-side scripting actions for various events. In addition to the core events common to most elements, BUTTON accepts the following event attributes:

  • ONFOCUS, when the element receives focus;
  • ONBLUR, when the element loses focus.

More Information

Copyright © 1998 by Liam Quinn. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).


Sponsor Sponsor


  © 1999-2006, web-geek.com a Geek Boy Enterprises, Inc. website terms and conditions of use [ Start Page ] [ Contacting ] [ About ] [ Link To US ]