BUTTON | NN n/a IE 4 DOM 1 | ||
The BUTTON object
reflects the BUTTON element. See the discussion of
the BUTTON element in | |||
HTML Equivalent<BUTTON> | |||
Object Model Reference
|
accessKey | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A single character key that "clicks" the button from the
keyboard. The browser and operating system determine whether the user
must press a modifier key (e.g., | |||
Exampledocument.all.myButton.accessKey = "n" | |||
Value Single alphanumeric (and punctuation) keyboard character. | |||
|
clientHeight, clientWidth | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
According to Microsoft's developer documentation, these properties reflect the height and width (in pixels) of the element's content | |||
Examplevar midHeight = document.all.myButton.clientHeight/2 | |||
Value Integer pixel value. | |||
|
clientLeft, clientTop | NN n/a IE 4 DOM n/a | ||
Read-only | |||
According to Microsoft's developer documentation, these properties reflect the distance between the "true" left and top edges of the document area and the edges of the element. To get or set the pixel position of an element in the document, use the pixelLeft and pixelTop properties. | |||
Value A string value for a length in a variety of units or percentage. | |||
|
dataFld | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to associate a remote data source column name to a BUTTON object's label. A DATASRC attribute must also be set for the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.myButton.dataFld = "linkURL" | |||
Value Case-sensitive identifier of the data source column. | |||
|
dataFormatAs | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding, this property advises the browser whether the source material arriving from the data source is to be treated as plain text or as tagged HTML. | |||
Exampledocument.all.myButton.dataFormatAs = "HTML" | |||
Value IE 4 recognizes two possible settings: text | HTML | |||
|
dataSrc | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Content from the data source is specified via the DATAFLD attribute in the BUTTON element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.myButton.dataSrc = "#DBSRC3" | |||
Value Case-sensitive identifier of the data source. | |||
|
disabled | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Whether the element is available for user interaction. When set to true, the element cannot receive focus or be modified by the user. It is also not submitted with the form. | |||
Exampledocument.all.myButton.disabled = true | |||
Value Boolean value: true | false. | |||
|
form | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns a reference to the FORM element that contains the current element (if any). This property is most often passed as a parameter for an event handler, using the this keyword to refer to the current form control. | |||
Example<BUTTON onClick="doValidate(this.form)">Click Here</BUTTON> | |||
Value Object reference. | |||
|
name | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The identifier associated with the element when used as a form control. The value of this property is submitted as one-half of the name/value pair when the form is submitted to the server. Names are hidden from user view, since control labels are assigned via other means, depending on the control type. Form control names may also be used by script references to the objects. | |||
Exampledocument.all.compName.name = "company" | |||
Value Case-sensitive identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character. | |||
|
scrollHeight, scrollWidth | NN n/a IE 4 DOM n/a | ||
Read-only | |||
The meaning of these two properties is ambiguous based on Microsoft's description and the way they're implemented in the Windows and Macintosh versions of Internet Explorer 4. My best guess is that these properties are intended to measure the height and width (in pixels) of the content of an element even when some of the content cannot be seen unless scrolled with scrollbars. The Macintosh version of the browser interprets this to mean the amount of the content that you can see at any one time. The important point is that for key elements, such as the BODY, the properties mean different things and can disrupt cross-platform operation. | |||
Examplevar midPoint = document.all.myButton.scrollHeight/2 | |||
Value Positive integer or zero. | |||
|
scrollLeft, scrollTop | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The distance in pixels between the actual left or top edge of the element's physical content and the left or top edge of the visible portion of the content. Setting these properties allows you to use a script to adjust the scrolling of content within a scrollable container, such as text in a TEXTAREA element or an entire document in the browser window or frame. When the content is not scrolled, both values are zero. Setting the scrollTop property to 15 scrolls the document upward by 15 pixels in the window; the scrollLeft property is unaffected unless explicitly changed. The property values change as the user adjusts the scrollbars. | |||
Exampledocument.all.myButton.scrollTop = 40 | |||
Value Positive integer or zero. | |||
|
status | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Unlike the status property of other types of form controls, the property has no visual impact on the button. | |||
Value Boolean value: true | false. | |||
|
tabIndex | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. A value of -1 removes the element from tabbing order altogether. Note that the Macintosh user interface does not provide for giving focus to elements other than text and password INPUT fields. | |||
Exampledocument.all.myButton.tabIndex = 6 | |||
Value Integer. | |||
|
type | NN n/a IE 4 DOM 1 | ||
Read-only | |||
Whether the BUTTON element is specified as a button, reset, or submit style button. | |||
Exampleif (document.all.myButtonElement.type == "submit") { ... } | |||
Value One of the three constants (as a string): button | reset | submit. | |||
|
value | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Current value associated with the form control that is submitted with the name/value pair for the element. Although the property is operational in Internet Explorer 4, the Macintosh version does not preserve values written to the property. | |||
Exampledocument.all.myButton.value = "completed" | |||
Value String. | |||
|
blur( ) | NN n/a IE 4 DOM n/a |
Removes focus from the current element and fires an onBlur event (in IE). No other element necessarily receives focus as a result. | |
Returned Value None. | |
Parameters None. |
createTextRange( ) | NN n/a IE 4 DOM n/a |
Creates a TextRange object from the source code of the current element. See the TextRange object for details. | |
Returned Value TextRange object. | |
Parameters None. |
focus( ) | NN n/a IE 4 DOM n/a |
Gives focus to the current element and fires the onFocus event (in IE). If another element had focus at the time, it receives an onBlur event. | |
Returned Value None. | |
Parameters None. |