Note : The
<BUTTON> element is a new element introduced in HTML 4.0 draft specifications and is currently only supported by Internet Explorer 4.0.
<BUTTON> element can be used to create buttons that are embedded into the document. The main difference between
<INPUT TYPE="button"...>, is that the
<BUTTON> element takes the entire content between the opening and closing elements and creates a pushable button from them. This means that most HTML content can be rendered as a button. For example:
...produces a button with a HTML
<TABLE> rendered on it:
The attributes for the
<BUTTON> element are:
ACCESSKEY attribute can be used to specify a shortcut key for the
<BUTTON> (activated by pressing 'Alt' and the
ACCESSKEY together - like standard Windows applications menu shortcuts). The
ACCESSKEY setting does not have to be a character in the actual button contents and the button is not modified in any way to reflect that an
ACCESSKEY has been defined.
CLASS attribute is used to specify the
<BUTTON> element as using a particular style sheet class. See the Style Sheets topic for details.
DATAFLD attribute can be used to specify a data column name from the Data source (see
DATASRC) that the
<BUTTON> is bound to. For more information on the
DATAFLD attribute, see the Data Binding topic.
<BUTTON> element is data-bound, it can accept straight text, or HTML from the data source. The
DATAFORMATAS attribute should be set to "
TEXT" or "
HTML" accordingly. with
DATAFORMATAS="HTML", the data provided for the
<BUTTON> element is parsed and rendered when it's displayed.
For more information on the
DATAFORMATAS attribute, see the Data Binding topic.
DATASRC attribute can be used to specify a data source that the
<BUTTON> is bound to. For more information on the
DATASRC attribute, see the Data Binding topic.
DISABLED attribute can be used to disable the
<BUTTON>. This means it won't respond to user input, or take the users focus.
ID attribute can be used to either reference a unique style sheet identifier, or to provide a unique name for the
<BUTTON> element for scripting purposes. Any
<BUTTON> element with an
ID attribute can be directly manipulated in script by referencing its
ID attribute, rather than working through the All collection to determine the element. See the Scripting introduction topic for more information.
LANG attribute can be used to specify what language the
<BUTTON> element is using. It accepts any valid ISO standard language abbreviation (for example
"en" for English,
"de" for German etc.) For more details, see the Document Localisation section for more details.
LANGUAGE attribute can be used to expressly specify which scripting language Internet Explorer 4.0 uses to interpret any scripting information used in the
<BUTTON> element. It can accept values of
LANGUAGE attribute is set.
As well as using previously defined style sheet settings, the
<BUTTON> element can have in-line stylings attached to it. See the Style Sheets topic for details.
The Internet Explorer 4.0 (and above) specific
TITLE attribute is used for informational purposes. If present, the value of the
TITLE attribute is presented as a ToolTip when the users mouse hovers over the
<INPUT> elements shouldn't be included in a
<BUTTON> element in a document is an object that can be manipulated through scripting. Note that scripting of the
<BUTTON> element/object is only supported by Internet Explorer 4.0 in its Dynamic HTML object model. Netscape does not support direct scripting of the
<BUTTON> element at all.
<BUTTON...> element/object supports all of the standard Dynamic HTML properties (i.e. className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName and title). Details of these can be found in the standard Dynamic HTML properties topics.
<BUTTON> element supports the accessKey, dataFld, dataFormatAs, dataSrc and disabled, which directly reflect the attributes of the same name.
<BUTTON...> element/object supports all of the standard Dynamic HTML methods (i.e. click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView and setAttribute). Details of these can be found in the standard Dynamic HTML Methods topics.
<BUTTON> element also supports the following methods:
blur event can be used to force the users focus away from the referenced
<BUTTON> element, firing the
createTextRange method can be invoked to create a TextRange object from the contents of the
<BUTTON> element. See the TextRange object topic for details of properties, methods and events applicable to text ranges.
focus method can be used to pass the users focus to the referenced
<BUTTON> element, forcing the
onfocus event to fire.
<BUTTON...> element/object supports all of the standard Dynamic HTML events (i.e. onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup and onselectstart). Details of these can be found in the standard Dynamic HTML events topics.
<BUTTON> element also supports:
When the referenced
<BUTTON> element loses the users focus, the
onblur event is fired.
When the user passes the focus to any
<INPUT> element, the
onfocus event is fired for that element.
© 1995-1998, Stephen Le Hunte
|file: /Techref/language/html/ib/Text_Formatting/but.htm, 12KB, , updated: 2010/9/8 20:26, local time: 2017/12/17 07:57,
|©2017 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/language/html/ib/Text_Formatting/but.htm"> <BUTTON></A>
|Did you find what you needed?|
PICList 2017 contributors:
o List host: MIT, Site host massmind.org, Top posters @20171217 RussellMc, Van Horn, David, Sean Breheny, James Cameron, alan.b.pearce, IVP, Neil, Bob Blick, David C Brown, John Gardner,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!